Skip to content

Instantly share code, notes, and snippets.

View afeld's full-sized avatar

Aidan Feldman afeld

View GitHub Profile
@afeld
afeld / gist:017862706282c10edb6e
Last active August 29, 2015 14:11
list contributors to a Git repository
require 'rugged'
repo = Rugged::Repository.new('.')
walker = Rugged::Walker.new(repo)
walker.push('refs/heads/gh-pages')
emails = walker.map do |commit|
commit.author[:email]
end
@afeld
afeld / gist:907334aaa586d885a12b
Created November 5, 2014 16:46
zero-length response in Node
var http = require('http');
var server = http.createServer(function (request, response) {
response.setHeader('content-length', 0);
response.end();
});
server.listen(8000, function() {
console.log("Server running at http://127.0.0.1:8000/");
@afeld
afeld / gist:70a6e16d8a2d85887dfa
Created October 20, 2014 05:44
find duplicate Eventbrite orders
require 'csv'
require 'pp'
csv = CSV.read('/Users/aidan/Downloads/Orders-13196243319.csv')
emails = csv.map{|c| c.last.downcase }
dupes = emails.select{ |e| emails.count(e) > 1 }.uniq
dupes.each do |dupe|
puts dupe
end
@afeld
afeld / gist:f81a90fbba3970dc2bf1
Last active August 29, 2015 14:06
test for ITP
function foo(){
console.log('bar');
}
@afeld
afeld / gist:906a5a382e90f10435fe
Created August 14, 2014 17:36
Please Stop +1-ing (PSP1)

Dear reader-

You are most likely reading this message becase you clicked through on a discussion thread where everything that needs to be said has been said, support for the proposal has clearly been established, and the conversation has devolved into people simply commenting with variations of "+1". Please recognize that this isn't moving the proposal forward, and is probably just frustrating whomever would actually be in a position of actually making it happen.

Thank you for your understanding.

-Aidan Feldman

@afeld
afeld / map.geojson
Last active August 29, 2015 14:01
Portland Meetup
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afeld
afeld / gh_unsub.rb
Last active August 29, 2015 14:00 — forked from anaisbetts/gh_unsub.rb
#!/usr/bin/env ruby
require 'octokit'
token = '***** GET A TOKEN *****'
c = Octokit::Client.new(:access_token => token)
user_login = c.user.login
puts "Finding your mentions...\n"
require 'date'
require 'rubygems'
require 'shopify_api'
ShopifyAPI::Base.site = '...'
@order = ShopifyAPI::Order.new
@order.line_items = [{
:quantity => 1,
:product_id => 222,
:variant_id => 333
@afeld
afeld / create1.rb
Created April 13, 2014 18:35
Shopify note_attributes not saving
order = ShopifyAPI::Order.new
order.line_items = [{
:quantity => 1,
:product_id => 222,
:variant_id => 333
}]
# as a JSON object
order.note_attributes = [{:foo => 'bar'}]
@afeld
afeld / gist:9558849
Last active August 29, 2015 13:57
"What if everything were open" talk abstract

In a world full of systems generating endless amounts of data, only a small fraction of this information is available to consumers in a format that's easily reusable. This talk is a thought experiment: what would be possible if all data were public, period? What would governments and businesses look like? What would it mean for privacy?

What types of information do we just take for granted as inaccessible, and what are the possibilities if it were open? We'll walk through a couple major news stories and examine how they could have been solved (if not avoided entirely) by full freedom of information. We'll also look at a few hypothetical situations, where entirely open data could make way for new possibilities in productivity, healthcare, transportation, and more.