Skip to content

Instantly share code, notes, and snippets.

View sllvn's full-sized avatar
🔥

Andrew Sullivan sllvn

🔥
View GitHub Profile
@gringocl
gringocl / kexp_playlist.json
Created May 25, 2014 18:54
kexp top 100 artists by total plays 2001 - 2014
{"_id"=>nil, "total_plays"=>486721}
{"_id"=>"(Various Artists) ", "total_plays"=>5858}
{"_id"=>"Radiohead", "total_plays"=>5181}
{"_id"=>"Beck", "total_plays"=>3713}
{"_id"=>"Built to Spill", "total_plays"=>3439}
{"_id"=>"Pixies", "total_plays"=>3404}
{"_id"=>"Modest Mouse", "total_plays"=>3173}
{"_id"=>"Arcade Fire", "total_plays"=>3130}
{"_id"=>"Death Cab for Cutie", "total_plays"=>3033}
{"_id"=>"Wilco", "total_plays"=>3019}

angular.injector

Creates an injector object that can be used for retrieving services as well as for dependency injection

  // create an injector
  var $injector = angular.injector(['ng']);
  // use the injector to kick off your application
  // use the type inference to auto inject arguments, or use implicit injection
 $injector.invoke(function($rootScope, $compile, $document){
@sllvn
sllvn / tally.rb
Created April 14, 2012 17:57
Verite Spotify contest vote tallier
#!/usr/bin/env ruby
# CSV file available at: http://dl.dropbox.com/u/24209319/Verite%20Spotify%20Playlist%20Voting-%20Foreign%20Languages.csv
require 'csv'
class Tally < Hash
def vote(key, x)
self[key] = 0 unless self[key]
self[key] += x
@tsibley
tsibley / Makefile
Created November 15, 2012 05:50
Seattle's Heritage Trees
publish:
ssh tsibley.net 'cd www/trees/seattle/ && git pull'
@rebeccawilliams
rebeccawilliams / opendatapolicies.csv
Last active June 21, 2016 04:30
Open Data Policies by Type, see more at: https://sunlightfoundation.com/policy/opendatamap/ & https://docs.google.com/spreadsheets/d/1ETZuGZBK24J2viZdxmhyIlIKiJuytAu3Bh1ofo_HVBw/; if there was an amendment/new EO I counted it again, also DC is listed as a city here w city-counties being counted as counties
year how many ordinance or law resolution exective order or directive admin memo, IT policy, etc city county state
2006 1 0 0 0 1 1 0 0
2009 3 2 0 1 0 2 1 0
2010 1 1 0 0 0 0 1 0
2011 4 2 1 0 1 1 2 1
2012 7 5 0 2 0 5 1 1
2013 16 7 0 5 4 8 3 5
2014 20 11 1 6 2 14 3 3
2015 8 1 1 3 3 8 0 0
2016 9 2 4 3 0 8 0 1
@PhillyCDO
PhillyCDO / philly-open-data-order.md
Created September 4, 2012 17:08
Open Data Executive Order for the City of Philadelphia

OPEN DATA AND GOVERNMENT TRANSPARENCY

WHEREAS, the City of Philadelphia is committed to creating a high level of openness and transparency in government; and

WHEREAS, the three principles of transparency, participation, and collaboration form the cornerstone of an open government; and

WHEREAS, the City’s participation as a founding and vital partner in the open data consortium has provided a model for transparency on which the City should continue to build; and

WHEREAS, more City data sets should be published and made available via an Open Data Portal which will provide access to information and a mechanism for public feedback and participation; and

@daviferreira
daviferreira / compiler.js
Last active April 18, 2017 21:42
Mocha compiler for es6 + react components with css require statements
'use strict';
var babel = require('babel-core');
var fs = require('fs');
// borrowed from https://github.com/babel/babel-jest/blob/master/index.js
require.extensions['.jsx'] = function (module, filename) {
var src = fs.readFileSync(filename, 'utf8');
// Allow the stage to be configured by an environment
// variable, but use Babel's default stage (2) if
@hjr3
hjr3 / dc_2017_biblio.md
Last active November 16, 2017 11:38 — forked from BaseCase/dc_2017_biblio.md
List of resources recommended or mentioned by the speakers at Deconstruct 2017

Deconstruct 2017 Bibliography

Here are all of the resources mentioned by Deconstruct 2017 speakers, along with who recommended what. Please post a comment if I missed something or have an error!

DC 2017 Speakers' Choice Gold Medalist

  • Seeing Like a State by James Scott

Books

  • Public Opinion by Walter Lippmann (Evan Czaplicki)
  • A Pattern Language by Christopher Alexander (Brian Marick)
  • Domain Driven Design by Eric Evans (Brian Marick)
@gonzalo-bulnes
gonzalo-bulnes / XXXXXXXXXXXXX_add_authentication_token_to_users.rb
Last active March 6, 2019 15:15
(Update: I've packaged this gist into a gem to make its use easier, see: https://github.com/gonzalo-bulnes/simple_token_authentication.) Add token authentication to your Rails API. Follows the José Valim recomendations and is fully compatible with Devise (tokens are created the first time users sign in). See https://gist.github.com/josevalim/fb7…
# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb
class AddAuthenticationTokenToUsers < ActiveRecord::Migration
def change
add_column :users, :authentication_token, :string
add_index :users, :authentication_token, :unique => true
end
end
@BaseCase
BaseCase / dc_2017_biblio.md
Last active January 23, 2020 05:13
List of resources recommended or mentioned by the speakers at Deconstruct 2017

Deconstruct 2017 Bibliography

Here are all of the resources mentioned by Deconstruct 2017 speakers, along with who recommended what. Please post a comment if I missed something or have an error!

DC 2017 Speakers' Choice Gold Medalist

  • Seeing Like a State by James Scott

Books

  • Public Opinion by Walter Lippmann (Evan Czaplicki)
  • A Pattern Language by Christopher Alexander (Brian Marick)
  • Domain Driven Design by Eric Evans (Brian Marick)