Skip to content

Instantly share code, notes, and snippets.

View jsdf's full-sized avatar

James Friend jsdf

View GitHub Profile
@jsdf
jsdf / node-sprockets-async
Last active August 29, 2015 14:14
poor man's sprockets (async)
#!/usr/bin/env node
var crypto = require('crypto')
var path = require('path')
var fs = require('fs')
var Promise = require('bluebird')
Promise.promisifyAll(fs)
function hash(input, algorithm, encoding) {
return crypto
@jsdf
jsdf / gist:24eadf09f23a293526f1
Created January 22, 2015 06:57
semaphore fullscreen log bookmarklet
javascript:var $textnode = $(getSelection().baseNode).closest('.output');if ($textnode.length) {$textnode.css({width:'100vw',height:'100vh',position: 'absolute',top: 0,left: 0,background: 'white'}).find('pre').css({height: '100%', 'box-shadow':'none', margin:0});$(window).scrollTop(0);$textnode.detach();$(document.body).css({width:'100vw',height:'100vh',overflow:'hidden'}).empty().append($textnode)} else {alert('select some text in an output log and then click the bookmarklet again')}
@jsdf
jsdf / exdrupal.coffee
Last active August 29, 2015 14:10
Drupal Services JSON export download in Coffeescript
merge = require 'xtend'
Promise = require 'bluebird'
request = Promise.promisify require 'request'
fs = require 'fs'
Promise.promisifyAll(fs)
servicesEndpointUrl = process.argv[2] or 'http://example.com/api'
contentType = process.argv[3] or 'node'
idType = process.argv[4] or 'nid'