Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Gunked Up Form</title>
<style>
:root {
--duration: 100ms;
}
@hurrymaplelad
hurrymaplelad / gist:7d69c32d60648ea54ac8
Last active February 23, 2016 19:36
Extract top-level name, version pairs from npm-shrinkwrap
# requires https://github.com/trentm/json
cat npm-shrinkwrap.json | json dependencies | json --items | json -a key 'value.version' | less
@hurrymaplelad
hurrymaplelad / package.json
Created October 4, 2014 05:47
NPM scripts for coffeescript modules
{
"scripts": {
"compile": "coffee --bare --compile --output lib/ src/",
"test": "mocha",
"pretest": "npm run compile",
"prepublish": "npm run compile"
}
}
@hurrymaplelad
hurrymaplelad / destructure_args.coffee
Last active December 12, 2015 00:08
Restructuring assignment examples
displayName = ({ name, age }) ->
console.log "#{name}, #{age} year(s) old"
coffee> displayName name: 'Foo', age: 42
Foo, 42 year(s) old
@hurrymaplelad
hurrymaplelad / teacup_example.coffee
Created January 8, 2013 22:41
A Teacup example
{renderable, a, h1, table, td, th, tr} = require 'teacup'
template = renderable ({posts})->
h1 'Listing posts'
table "#posts-table", ->
tr ->
th 'Title'
th 'Content'
for post in posts
tr '.post-row', ->
@hurrymaplelad
hurrymaplelad / mongoose_remove_property.spec.coffee
Created November 25, 2012 23:35
Consolidated spec for Mongoose.js attribute removal described in https://gist.github.com/4008255
mongoose = require 'mongoose'
expect = require 'expect.js'
db = null
before (done) ->
db = mongoose.createConnection('localhost', 'test').once('open', done)
describe 'Food Model', ->
Food = null
@hurrymaplelad
hurrymaplelad / tumblerGists.terse.js
Last active October 13, 2015 05:27 — forked from asalant/tumblerGists.terse.js
Embed gist on Tumbler
//From https://gist.github.com/637764
$(function() {
var gistPrefix = 'http://gist.github.com/',
// Cache document.write so that it can be restored once all Gists have been
// embedded.
cachedWrite = document.write,
wroteStyle = false,
body = $('body'),
// Map each p.gist to an object that contains the paragraph to be replaced
// and the Gist's identifier.
@hurrymaplelad
hurrymaplelad / io.gitconfig
Created November 16, 2012 08:59
Git IO alias to show incoming and outgoing changesets
[alias]
io = !git fetch && git log --left-right @{upstream}...
@hurrymaplelad
hurrymaplelad / broccoli.js
Created November 3, 2012 18:50
Attempts to remove an attribute from mongo docs that isnt defined in the mongoose schema
var broccoli = new Food({
name: 'frozen broccoli',
organic: true
});