Skip to content

Instantly share code, notes, and snippets.

View saranrapjs's full-sized avatar

Jeff Sisson saranrapjs

View GitHub Profile
@saranrapjs
saranrapjs / README.md
Created August 4, 2023 15:22
Aggregating the $$$ you spend on OMNY by month

Aggregating the $$$ you spend on OMNY by month

The OMNY dashboard allows you to export Trip History as a CSV. This is a really basic script that aggregates how much you spend on OMNY by month, given the trip-history.csv file you get from OMNY.

Here's how you can run it from the unzipped OMNY download directory:

sqlite3 -init trips.sql trips.db .quit
@saranrapjs
saranrapjs / check.js
Created March 30, 2021 01:54
vax4nyc calendar refresher so you don't have to click
(function check() {
// they have hijacked document.querySelector/getElementById/etc but not document.all
Array.from(document.all).filter(el => el.nodeName.toLowerCase() === 'lightning-button-icon')[0].click();
setTimeout(() => {
Array.from(document.all).filter(el => el.name === 'today')[0].click();
setTimeout(() => {
const none = /check back/.test(Array.from(document.all).filter(el => el.className === 'appointment-section')[0].textContent)
console.warn('none', none)
if (none && !window.stoppy) setTimeout(check, 200);
}, 8000)
@saranrapjs
saranrapjs / toProseMirrorTestBuilder.js
Created September 9, 2019 14:29
Converts real & present ProseMirror nodes to their test-builder equivalents
// suitable for use w/ this: https://github.com/ProseMirror/prosemirror-test-builder
function toProseMirrorTestBuilder(node, funcPrefix = 'nodes.') {
if (node.isText) {
return `"${node.textContent}"`;
}
return `${funcPrefix}${node.type.name}(${node.content.content.map(child => toProseMirrorTestBuilder(child))})`
}
@saranrapjs
saranrapjs / default.vcl
Last active February 15, 2018 19:22
Varnish + JSONP example
vcl 4.0;
backend default {
.host = "127.0.0.1";
.port = "80";
}
sub vcl_recv {
unset req.http.callback;
@saranrapjs
saranrapjs / whatever.bash
Created February 22, 2017 00:40
ipfs demo
ipfs cat QmWqQogxm2JLhhvdcYoycnAiTiCNCC6zh3WA5bWnttzrfr
@saranrapjs
saranrapjs / mtime_file_watcher.py.patch
Created January 20, 2017 16:39
This patch fixes the `goapp` local dev server to ignore GOPATH changes, the watching of which would otherwise yield the "There are too many files in your application for changes in all of them to be monitored" error.
--- mtime_file_watcher.py 2017-01-20 11:36:51.000000000 -0500
+++ mtime_file_watcher.py.new 2017-01-20 11:37:24.000000000 -0500
@@ -139,6 +139,9 @@
"""
filename_to_mtime = {}
num_files = 0
+ gopath = os.environ["GOPATH"]+os.sep+"src"
+ if self._directory == gopath:
+ return filename_to_mtime
for dirpath, dirnames, filenames in os.walk(self._directory,
@saranrapjs
saranrapjs / spam1.txt
Created August 19, 2016 15:12
I got these two insane & long-form penny stock spam emails....I believe this is prose, not programmatically generated, but who can say for sure!
This may be the last way left for
the little trader to get rich…
Matt dropping by…
I always root for the underdog…
I guess it’s because I can relate? (I was one of the smaller
kids in school that didn’t always get treated
so well… but my mother and the Marines
@saranrapjs
saranrapjs / nyc_llc_bot.js
Created November 20, 2013 00:44
Code that generates the bot for https://twitter.com/NYCLLC
// requires: sqlite3, ntwitter
var sqlite3 = require('sqlite3'),
db = new sqlite3.Database('biz.db'),
twitter = require('ntwitter');
var twit = new twitter({
consumer_key: 'all',
consumer_secret: 'your',
access_token_key: 'tokens',
@saranrapjs
saranrapjs / youtube_slowed.bash
Last active December 27, 2015 15:09
Download & Slowdown a YouTube video using ffmpeg && youtube-dl
# add this to yer .bash_profile ==>
function youtube_slower {
if [ ! -z $2 ]; then
tempo="$2"
else
tempo="0.8"
fi
base_filename="$(youtube-dl "$1" --get-filename)"
extensionless="${base_filename%.*}"
@saranrapjs
saranrapjs / PHPUNIT.sublime-build
Created September 13, 2013 20:36
sublime build system for phpunit
{
"cmd": ["${project_path}vendor/bin/phpunit", "-c", "${project_path}test/phpunit.xml", "test"],
"file_regex": "php$",
"working_dir": "${project_path:${folder}}",
}