Skip to content

Instantly share code, notes, and snippets.

Jeff Sisson saranrapjs

Block or report user

Report or block saranrapjs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@saranrapjs
saranrapjs / toProseMirrorTestBuilder.js
Created Sep 9, 2019
Converts real & present ProseMirror nodes to their test-builder equivalents
View toProseMirrorTestBuilder.js
// 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))})`
}
View whatever.bash
ipfs cat QmWqQogxm2JLhhvdcYoycnAiTiCNCC6zh3WA5bWnttzrfr
@saranrapjs
saranrapjs / mtime_file_watcher.py.patch
Created Jan 20, 2017
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.
View mtime_file_watcher.py.patch
--- 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 Feb 15, 2018
Varnish + JSONP example
View default.vcl
vcl 4.0;
backend default {
.host = "127.0.0.1";
.port = "80";
}
sub vcl_recv {
unset req.http.callback;
@saranrapjs
saranrapjs / spam1.txt
Created Aug 19, 2016
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!
View spam1.txt
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 Jun 25, 2015
nested sass animation
View test.scss
.custom-selector {
& {
color:blue;
}
@-webkit-keyframes zoomer {
from {
transform:scale(0.5);
}
@saranrapjs
saranrapjs / README.md
Last active Aug 29, 2015
RUM-SpeedIndex bookmarklet
View README.md

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 Aug 29, 2015
blink1 forecast.io warmer/cooler
View index.js
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,
@saranrapjs
saranrapjs / filter.js
Created Jul 31, 2014
filter string of html with only italic and bold text left in
View filter.js
function filter(input) {
var elements;
if (typeof input === 'string') {
var div = document.createElement('div');
div.innerHTML = input;
elements = div.childNodes;
} else {
elements = input.childNodes;
}
@saranrapjs
saranrapjs / links.js
Last active Aug 29, 2015
get all links on ze page
View links.js
You can’t perform that action at this time.