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 / 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 / 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 / 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 / test.scss
Created June 25, 2015 20:39
nested sass animation
.custom-selector {
& {
color:blue;
}
@-webkit-keyframes zoomer {
from {
transform:scale(0.5);
}
@saranrapjs
saranrapjs / README.md
Last active August 29, 2015 14:20
RUM-SpeedIndex bookmarklet

RUM-SpeedIndex Bookmarklet

Very simple bookmarklet which, when run, will display the RUM-SpeedIndex (derived from this script) from the current page. Chrome-only, as far as I'm aware.

@saranrapjs
saranrapjs / index.js
Last active August 29, 2015 14:09
blink1 forecast.io warmer/cooler
var Forecast = require('forecast.io'),
options = {
APIKey: process.env.FORECAST_API_KEY
},
forecast = new Forecast(options),
weathercolor = require('./weathercolor.js');
forecast.get(40.681975, -74.003441, function (err, res, data) {
if (err) throw err;
var nowTemp = data.currently.temperature,