Skip to content

Instantly share code, notes, and snippets.

View nixme's full-sized avatar

Gopal Patel nixme

  • Qualified.com
  • San Francisco
  • X @nixme
View GitHub Profile
@nixme
nixme / keybase.md
Created July 18, 2016 18:03
keybase.md

Keybase proof

I hereby claim:

  • I am nixme on github.
  • I am nixme (https://keybase.io/nixme) on keybase.
  • I have a public key ASA3bPJsXsPpv5uKWQ2inQkFW9_BAea3sqZxuOLbu-GLhgo

To claim this, I am signing this object:

class User < ActiveRecord::Base
attr_accessible :fb_id, :name, :profile_img_url, :spotify_id
has_many :votes
has_many :songs, through: :votes
end
class Vote < ActiveRecord::Base
belongs_to :user
belongs_to :song
@nixme
nixme / acr122u.rb
Created May 17, 2012 08:00
Read NFC tag IDs from a Tagstand ACR122U USB reader
# Quick and dirty script to read unique IDs from NFC tags using the ACR122U USB
# reader.
#
# PC/SC-based API details for the ACR122U available at
# http://acs.com.hk/drivers/eng/API_ACR122U_v2.01.pdf
#
# Assumes ruby >= 1.9.2
# `gem install smartcard` first
#
@nixme
nixme / deflater-ext.rb
Created February 29, 2012 23:48
Rack::Deflater body close fixes
require 'rack/deflater'
module Rack
class Deflater
def call(env)
status, headers, body = @app.call(env)
headers = Utils::HeaderHash.new(headers)
# Skip compressing empty entity body responses and responses with
# no-transform set.
#!/usr/bin/env ruby
puts ARGV[rand(ARGV.size)]