Skip to content

Instantly share code, notes, and snippets.

View unforswearing's full-sized avatar

Alvin Charity unforswearing

View GitHub Profile
@rmtbb
rmtbb / ChatGPT Canvas HTML Renderer from Clipboard.url
Last active July 5, 2025 17:49
Bookmarklet that lets you render a full HTML page with any included css and javascript that is currently copied to your clipboard. Also works for SVG code. Useful with ChatGPT Canvas
javascript:(function(){try{navigator.clipboard.readText().then(function(t){if(t){var e=window.open("","_blank","width=800,height=600");e.document.open(),e.document.write(t),e.document.close()}else alert("Clipboard is empty. Please copy some text to the clipboard first.")}).catch(function(t){console.error("Failed to read clipboard contents: ",t),alert("An error occurred while trying to access the clipboard. Please ensure your browser allows clipboard access.")})}catch(t){console.error("An error occurred:",t),alert("An error occurred while trying to open the new window with the clipboard content.")}})();//bookmarklet_title: HTML Preview from Clipboard
@alimbada
alimbada / CleanUpGmail.gs
Created May 15, 2024 22:41
Google Apps Script for cleaning up Gmail
function cleanUpGmail() {
var queries = [
'from:([email protected]) in:inbox subject:(from your Steam wishlist on sale) older_than:7d',
'from:([email protected]) in:inbox subject:(is live) older_than:1d',
'from:ebay.com subject:("is live!" OR "has been relisted") older_than:7d',
// Security alerts
'from:([email protected]) in:inbox subject:("Security alert" OR "New sign-in from") older_than:1m',
// 2FA
'from:([email protected]) in:inbox older_than:1d subject:("two-step authentication" )'
]
@tanaikech
tanaikech / submit.md
Created November 11, 2019 05:44
Figma to Google Slides using Google Apps Script

Figma to Google Slides using Google Apps Script

In this sample script, all pages in the Figma file are retrieved and the retrieved pages are put to new Google Slides as the image.

Usage

1. Retrieve access token

You can see the method for retrieving the access token at here. Although there is also OAuth2 for retrieving the access token, in your situation, I thought that the method for directly generating the access token on the site might be suitable. So in this answer, the generated access token on the site is used. Please retrieve the access token as follows.

@tanaikech
tanaikech / readme.md
Last active June 22, 2024 02:21
Retrieving Access Token for Service Account using Google Apps Script

Retrieving Access Token for Service Account using Google Apps Script

Updated on June 22, 2024

This is a sample script for retrieving the access token for Service Account using Google Apps Script. The flow for using this script is as follows.

Usage

  1. Create the Service Account and retrieve JSON file.
  2. Put Scopes, private_key and client_email as an object.
@mreigen
mreigen / generate-alphabets.js
Created November 20, 2017 05:55
Javascript generate alphabet string
function generateAlphabets() {
var alphabets = [];
var start = 'A'.charCodeAt(0);
var last = 'Z'.charCodeAt(0);
for (var i = start; i <= last; ++i) {
alphabets.push(String.fromCharCode(i));
}
return alphabets.join('');
}
@codediodeio
codediodeio / database.rules.json
Last active May 11, 2025 08:08
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@AriaFallah
AriaFallah / sec.sh
Last active July 8, 2025 07:42
MacOS security CLI wrapper
#!/usr/bin/env bash
KEYCHAIN="secrets.keychain"
main () {
if [[ -z "$1" ]]; then
print_usage
fi
case "$1" in
@vemacs
vemacs / compton.conf
Last active May 8, 2023 16:57
Reasonable compton.conf (fixes shadows in the stock desktop environment) for Xubuntu 16.04
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
@windyinsc
windyinsc / createinstallmedia.md
Last active May 15, 2025 02:25
Create a bootable installer for macOS

Create a bootable installer for macOS

The following instructions were predominantly sourced via this Apple Support Document.

With macOS, you can use a USB flash drive or other removable media as a startup disk from which to install macOS. These advanced steps are intended primarly for system administrators and others who are familiar with the command line.

The final executable command(s) are found within Section III. Final macOS Executable Commands labled as Full Example or Full Example w/Options. I personally use the w/Options command which include both the --nointeraction and &&say Installation commands.

I. Overview

@tzmartin
tzmartin / embedded-file-viewer.md
Last active July 7, 2025 09:26
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links