Skip to content

Instantly share code, notes, and snippets.

Alan Skorkin skorks

Block or report user

Report or block skorks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am skorks on github.
  • I am skorks ( on keybase.
  • I have a public key whose fingerprint is C4A4 FACD A3B4 7BF1 AF06 3F7C E884 65D0 75A1 3DA9

To claim this, I am signing this object:

skorks / gist:3753926
Created Sep 20, 2012
External root document
View gist:3753926
":href": "http://localhost:8080/external",
":type": "application/",
"user": {
":href": "http://localhost:8080/external/users/{token}",
":type": "application/vnd.playup.external.user+json"
View gist:3746981
":type": "application/vnd.playup.extension+json",
":uid": "",
":display": {
":self": "",
":type": "application/",
"summary": "Photo Feature\nLorem ipsum dolor sit amet, consectetur adipisicing elit",
"image": "",
"footer_title": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
"footer_subtitle": "Where sport gets social",
View gist:1881521
#!/usr/bin/env ruby
#need irbtools gem isntalled for all these to be pulled in
#need irbtools-more gem isntalled for all these to be pulled in
#you probably want these in rvm global gemset so it get pulled into all the rubies
require 'rubygems' unless defined? Gem # only needed in 1.8
require 'irbtools/configure'
skorks / asset_tag_helper.rb
Created Jul 8, 2011 — forked from matthewtodd/asset_tag_helper.rb
Rails + Sass + Asset Fingerprints + Heroku
View asset_tag_helper.rb
# Ensure AssetTagHelper has been loaded before we try to monkey-patch it.
require 'action_view/helpers/asset_tag_helper'
module ActionView::Helpers::AssetTagHelper
# Insert the asset id in the filename, rather than in the query string. In
# addition to looking nicer, this also keeps any other static file handlers
# from preempting our Rack::StaticCache middleware, since these
# version-numbered files don't actually exist on disk.
def rewrite_asset_path(source)
source.insert source.rindex('.'), "-#{rails_asset_id(source)}"
skorks / deploy.rake
Created Jul 8, 2011 — forked from jbarnette/deploy.rake
Heroku deploy via rake
View deploy.rake
# Hoptoad integration example.
task "deploy:before" => "isolate:dotgems" do
if /\.gems/ =~ `git status`
abort "Changed gems. Commit '.gems' and deploy again."
ENV["TO"] = Deploy.env
skorks / subset_sum_dynamic.rb
Created Feb 26, 2011
Solving the subset sum problem via dynamic programming
View subset_sum_dynamic.rb
require 'terminal-table/import'
class SubsetSumMatrix
class << self
def create_empty_for(array)
matrix = []
header = [nil] + build_header_from(array)
matrix << header
array.each_with_index do |element,i|
row = header.collect{|value| 'F'}
skorks / gist:812210
Created Feb 5, 2011
git prompt showing branch and dirty state
View gist:812210
#put this in .bashrc
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo " *"
export PS1='[\u@\h \W\[\e[1;35m\]$(__git_ps1 " (%s$(parse_git_dirty))")\[\e[0;39m\]]\$ '
skorks / integertobetterenglish.rb
Created Nov 4, 2010
how integer to english would look if english was more consistent and sane when it comes to naming numbers
View integertobetterenglish.rb
#!/usr/bin/env ruby
NTW = {
1 => "one",
2 => "two",
3 => "three",
4 => "four",
5 => "five",
6 => "six",
7 => "seven",
skorks / integertoenglish.rb
Created Nov 3, 2010
converting integers to english
View integertoenglish.rb
#!/usr/bin/env ruby
NTW = {
1 => "one",
2 => "two",
3 => "three",
4 => "four",
5 => "five",
6 => "six",
7 => "seven",
You can’t perform that action at this time.