Skip to content

Instantly share code, notes, and snippets.

View greatseth's full-sized avatar

Seth Thomas Rasmussen greatseth

View GitHub Profile
_\m/ ~/p/generator-interactive (master #) | npm install -g node-inspector
> [email protected] preinstall /usr/local/lib/node_modules/.staging/v8-debug-5be573b2
> node -e 'process.exit(0)'
> [email protected] preinstall /usr/local/lib/node_modules/.staging/v8-profiler-4971d27a
> node -e 'process.exit(0)'
/usr/local/bin/node-inspector -> /usr/local/lib/node_modules/node-inspector/bin/inspector.js
* 2015-11-16 15:38:34 15:38:34 == Currently executing `deploy:assets:update_asset_mtimes'
~/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler/rubygems_integration.rb:292:in `block in replace_gem': sprockets is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
from ~/.rvm/gems/ruby-2.2.2/bin/sprockets:22:in `<main>'
from ~/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
from ~/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'
hash = JSON.parse temp
whitelist = ["employee","provider","visitor","security"]
array << hash if whitelist.include? hash["type"]
@greatseth
greatseth / ༼ つ ◕_◕ ༽つ
Created July 6, 2015 14:54
༼ つ ◕_◕ ༽つ
༼ つ ◕_◕ ༽つ
@greatseth
greatseth / collection.js
Created August 11, 2014 16:32
Backbone collection subclass attempting to wrap a pattern during initialization. Does not seem to work!
define([
'underscore',
'backbone'
], function (_, Backbone) {
var Collection = Backbone.Collection.extend({
initialize: function(klass, objects) {
Backbone.Collection.prototype.initialize.
apply(this, _.flatten([objects]), { model: klass });
}
});
@greatseth
greatseth / app.build.js
Created August 1, 2013 15:49
r.js build file
({
"name": "main",
"out": "main-built.js",
"baseUrl": ".",
"paths": {
"shim": "..\/..\/..\/vendor\/shim",
"respond": "..\/..\/..\/vendor\/respond\/1.1.0\/respond.src",
"jquery": "..\/..\/..\/vendor\/jquery\/jquery-1.8.3",
"container": ".",
"ap": "..\/..\/..\/ap\/branches\/2.0.0.rc",
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
Bundler.setup :gasbuddy
require 'json'
require 'couchrest'
require_relative 'gasbuddy/averages'
define([
'shape-map/shape-map',
'underscore'
], function(module, _) {
var map;
beforeEach(function() {
map = new module.ShapeMap();
});
@greatseth
greatseth / reduce.js
Created November 29, 2012 20:28
couchdb reduce function to find min value
function (key, values, rereduce) {
var min = Infinity
for (var i = 0; i < values.length; i++) {
if (typeof values[i] == 'number') {
max = Math.min(values[i], min)
}
}
return min
_\m/ erica (master) | curl http://127.0.0.1:5984/gasbuddy-averages-2/_design/averages/_view/averages | grep Hawaii
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6430k 0 6430k 0 0 1819k 0 --:--:-- 0:00:03 --:--:-- 1820k{"id":"5131debda18edb4802dc77cdba9773f2","key":["Hawaii",1353010316],"value":{"_id":"5131debda18edb4802dc77cdba9773f2","price":4.1139999999999998792,"change":-0.036999999999999998168,"timestamp":1353010316}},
{"id":"5131debda18edb4802dc77cdba9095e0","key":["Hawaii",1353011620],"value":{"_id":"5131debda18edb4802dc77cdba9095e0","price":4.1159999999999996589,"change":-0.035000000000000003331,"timestamp":1353011620}},
{"id":"5131debda18edb4802dc77cdba89cf83","key":["Hawaii",1353018329],"value":{"_id":"5131debda18edb4802dc77cdba89cf83","price":4.1150000000000002132,"change":-0.03599999999999999728,"timestamp":1353018329}},
{"id":"5131debda18edb4802dc77cdba82e9d1","key":