Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am skorks on github.
  • I am skorks (https://keybase.io/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
skorks / gist:3753926
Created Sep 20, 2012
External root document
View gist:3753926
{
":href": "http://localhost:8080/external",
":type": "application/vnd.playup.provider.services+json",
"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": "tile.photo.featured.1",
":display": {
":self": "http://www.zombo.com/tileupdates.json",
":type": "application/vnd.playup.display.feature.photo+json",
"summary": "Photo Feature\nLorem ipsum dolor sit amet, consectetur adipisicing elit",
"image": "http://www.footballfedvic.com.au/uploads/pics/BoxHill_South_Emily_Web.jpg",
"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'
Irbtools.remove_library(:hirb)
Irbtools.remove_library(:boson)
Irbtools.remove_library(:wirb)
@skorks
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
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."
end
ENV["TO"] = Deploy.env
end
@skorks
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
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
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
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.