Skip to content

Instantly share code, notes, and snippets.

View jasonkuhrt's full-sized avatar
🏔️
Building Prisma Cloud

Jason Kuhrt jasonkuhrt

🏔️
Building Prisma Cloud
View GitHub Profile
@jasonkuhrt
jasonkuhrt / main.coffee
Created January 29, 2011 21:24
fab+coffee
module.exports = (exports,imports)->
return imports (run, node$listen, route, ignore, write, stream, html, head, node$fs, sleep)->
run()
(node$listen,0xFAB)
()
@jasonkuhrt
jasonkuhrt / gist:839884
Created February 23, 2011 02:39
git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# (commit or discard the untracked or modified content in submodules)
#
# modified: bundle/l9 (untracked content)
# modified: bundle/mustang (modified content, untracked content)
# modified: bundle/peepopen (untracked content)
#
@jasonkuhrt
jasonkuhrt / gist:867719
Created March 13, 2011 00:01
Getters and Settings in CS, throwing error?
obj =
index: section.index
name: section.name
slug: ''
get slug()->
this.name.replace /\s/g, '-'
pug: ''
get pug()->
this.name.replace /\s/g, '_'
path: ''
@jasonkuhrt
jasonkuhrt / gist:867828
Created March 13, 2011 02:51
nice-commas
obj = {
one
, two
, three
, four
}
@jasonkuhrt
jasonkuhrt / gist:888872
Created March 27, 2011 02:59
desired loop
var param, args, __results, _i, _ref, _len;
__results = [];
for (_i = 0, _len = (_ref = params).length; _i < _len; ++_i) {
param = _ref[_i];
if (param in kwargs){
__results.push(kwargs[param]);
}
}
args = __results;
@jasonkuhrt
jasonkuhrt / directive_anchorable.coffee
Created September 15, 2012 14:11
Angular js directive for helping make traditional anchors work
directive_anchorable = ($anchorScroll)->
(scope, el, attrs)->
attrs.$observe attrs.id, ->
$anchorScroll()
@jasonkuhrt
jasonkuhrt / package.js
Created September 19, 2012 02:40
meteor yaml package file
Package.describe({
summary: "yaml to js"
});
var js_yaml = require('js-yaml');
var fs = require('fs');
Package.register_extension("yaml", function (bundle, source_path, serve_path, where) {
serve_path = serve_path + '.js';
@jasonkuhrt
jasonkuhrt / package.js
Created September 28, 2012 18:37
Attempting to cleanly bring jade to meteor
Package.describe({
summary: "jade's indentation-based html syntax"
});
var jade = require('/usr/local/lib/node_modules/jade');
var fs = require('fs');
var path = require('path');
var html_scanner = require('/Users/jasonkuhrt/code/meteor/packages/templating/html_scanner.js');
@jasonkuhrt
jasonkuhrt / next-or-first.jq.ls
Created October 1, 2012 20:05
Helper function to select next sibling or farthest left i.e. parent's first-child (this is helpful for looping galleries, etc.)
jQuery.fn.next-or-first = ->
$next = @next!
if not empty $next then $next else @parent!children!first!
@jasonkuhrt
jasonkuhrt / weather.ls
Created October 4, 2012 04:39
Rewriting (and playing with) meteor deps docs reactive example into livescript
prelude.install-prelude global
class Weather
(@temperature=30degrees)->
@listeners = {}
get-temp: ->
@_try-registering-reactive-context!
@temperature