Skip to content

Instantly share code, notes, and snippets.

View yrgoldteeth's full-sized avatar

Nicholas Fine yrgoldteeth

View GitHub Profile
[{"x"=>1.8733333333333335,
"y"=>"1.04",
"z"=>"0.08",
"label"=>
{"color"=>"#4bb2c5",
"label"=>"2379 - Other Heavy and Civil Engineering Construction"}},
{"x"=>3.5825000000000005,
"y"=>"0.44",
"z"=>"0.13",
"label"=>

Rails Asset Path CSS

$ sed 's/url(([^(]*))/url(<%= asset_path("\1") %>)/g' styles.css > styles.css.erb

Assumptions

  • Ruby 1.9.2
  • Rails 3.1.0
  • Ubuntu Server 11.04

Server Setup

apt-get update

apt-get upgrade -y

Array.max = (array) ->
Math.max.apply Math, array
Array.min = (array) ->
Math.min.apply Math, array
@yrgoldteeth
yrgoldteeth / instapaper_userstyle.css
Created September 3, 2011 05:58
My userstyle for the instapaper site.
body {
background: #000000 !important;
color: #f4f4f4 !important;
font-family: helvetica, sans-serif !important;
}
a:link {
color: #61BFC1 !important;
font-weight: normal !important;
text-decoration:none !important;
}
def expensive_method
@expensive_method_result ||= expensive_thing
end
# **Whereabouts** is a Rails plugin that generates a polymorphic, inheritable
# Address model. Install it as a Rails plugin (Rails 3.x+ required)
#
# rails plugin install http://github.com/yrgoldteeth/whereabouts.git
#
# The most simple use case creates a has_one relationship with
# a generic Address:
#
# class Foo < ActiveRecord::Base
# has_whereabouts
# **Whereabouts** is a Rails plugin that generates a polymorphic, inheritable
# Address model. Install it as a Rails plugin (Rails 3.x+ required)
#
# rails plugin install http://github.com/yrgoldteeth/whereabouts.git
#
# The most simple use case creates a has_one relationship with
# a generic Address:
#
# class Foo < ActiveRecord::Base
# has_whereabouts
@yrgoldteeth
yrgoldteeth / elite
Created April 26, 2011 16:12
bash prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function elite
{
local GRAY="\[\033[1;30m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
local CYAN="\[\033[0;36m\]"
@yrgoldteeth
yrgoldteeth / aliases
Created April 26, 2011 16:11
aliases
#directory stuff
alias la='ls -a'
alias ll='ls -l'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias .......='cd ../../../../../..'
alias ~='cd ~'