Skip to content

Instantly share code, notes, and snippets.

View sllvn's full-sized avatar
🔥

Andrew Sullivan sllvn

🔥
View GitHub Profile
@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
@forabi
forabi / Webpack 2.0.7-beta vs Rollup
Last active January 28, 2020 08:54
Webpack 2 vs Rollup
❯ rollup --version
rollup version 0.25.3
❯ time rollup -c ./rollup.js
rollup -c ./rollup.js 4.65s user 0.22s system 118% cpu 4.131 total
❯ time webpack
Hash: ebb00bbccd954c114d3c
Version: webpack 2.0.7-beta
Time: 3623ms
@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

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){

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@ericelliott
ericelliott / essential-javascript-links.md
Last active May 7, 2024 01:25
Essential JavaScript Links
@nyg
nyg / iOSCreatePDF.swift
Last active April 2, 2024 11:09
iOS, Swift: Create a PDF file from an HTML string.
// Thanks to http://www.labs.saachitech.com/2012/10/23/pdf-generation-using-uiprintpagerenderer
// Note: including images in the HTML won't work, see here:
// https://github.com/nyg/HTMLWithImagesToPDF
import UIKit
// 1. Create a print formatter
let html = "<b>Hello <i>World!</i></b>"
let fmt = UIMarkupTextPrintFormatter(markupText: html)
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@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}
@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