Skip to content

Instantly share code, notes, and snippets.

View bng44270's full-sized avatar

Andy Carlson bng44270

View GitHub Profile
@bng44270
bng44270 / webnotepad.js
Last active April 9, 2024 20:09
Create a local-storage browser-based notepad
/*
WebNotepad - create a local-storage browser-based notepad app
Usage:
1) Include webnotepad.js
2) Create DIV element
<div id="webnote"></div>
@bng44270
bng44270 / dcstones.json
Last active October 16, 2023 02:38
Washington, DC Boundary Stone locations in GeoJSON format
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bng44270
bng44270 / githubfile.gs
Last active June 14, 2023 14:37
Update Files using Github API from Google Script
/*
Update Files using Github API from Google Script
Installation:
1) Add file to the top of the list in App Script project
2) Add the following script properties to App Script project:
github_user -> will contain the username of the commit user
@bng44270
bng44270 / jsonfs.ps1
Last active May 12, 2023 13:55
Create JsonFS File from Directory in PowerShell
##################################
#
# Create JsonFS File from Directory in PowerShell
#
# Usage:
#
# New-JsonFSFile -Path <directory-path> -File <target-JSON-file> [-Unicode $True]
#
# If the -Unicode option is omitted text files will be encoded ASCII values
#
@bng44270
bng44270 / polyfills.js
Last active May 12, 2023 13:04
Useful String, Number, Date, and Array object polyfills
/*
Convert Unicode string to ASCII string
*/
String.prototype.toASCII = function() {
return this.replace(/\x00/g,'');
};
/*
Recreation of the Python STRING.format() function
@bng44270
bng44270 / typer.py
Last active April 22, 2023 03:25
Wrapper for xdotool used for simulating key strokes
########################################
# Typer - Wrapper for xdotool key stroke functionality
#
# Usage:
#
# Create Typer instance
#
# k = Typer()
#
# Create Typer instance with custom X windows display name
@bng44270
bng44270 / callguard.gs
Created April 14, 2023 15:55
Add phone numbers found in Gmail e-mails to a Google single contact
/*
Add phone numbers found in Gmail e-mails to a Google single contact
Usage:
1. Create a contact (use an purposely invalid e-mail address) i.e. sender-emails@myaccount
2. Include this script in your project
@bng44270
bng44270 / sheetlog.gs
Last active April 10, 2023 16:57
Add log entries to a Google Sheet
/*
Logs a row of data point to Google Sheets
Requirements:
Create two script properties, log_file and log_sheet, which contain the file ID of the spreadsheet
and the sheet containing the log respectively
The first row of the spreadsjeet is reserved for column headers
@bng44270
bng44270 / ifttt.gs
Last active April 10, 2023 12:13
Call IFTTT Webhooks from Google Scripts
/*
GsIFTTT
Call IFTTT Webhooks from Google Scripts
Setup:
Add a Script Property to your project named "ifttt_key" to store your IFTTT API Key
@bng44270
bng44270 / githubfile.js
Last active April 6, 2023 15:21
Update Repository Files using Github API
/*
Update Repository Files using Github API
Requires webrequest.js (https://gist.github.com/bng44270/61122a1947591d50004fcd9ee72d643d)
Usage:
var gh = new GithubFile('API-TOKEN','USERNAME','EMAIL-ADDRESS');
var prFile = gh.getFile('REPOSITORY','FILE-PATH');