Skip to content

Instantly share code, notes, and snippets.

View graybill's full-sized avatar

Linus Graybill graybill

  • Philadelphia, PA
View GitHub Profile
{% set DataSource %}node-filter-tags{% end %}
{% begin contents %}
<img src="%#primary-media.#thumbnails=100x100.#url%" alt="%Title%" />
{% end %}
include Newflow
define_workflow do
state :draft, :start => true do
transitions_to :published, :if => lambda { true }
end
state :published do
transitions_to :unpublished , :if => lambda { true }
end
❼ > rake db:migrate --trace
(in /Users/lgraybill/code/pifa-on-rails)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
Requiring REXML
** Execute db:migrate
== CreateGalleries: migrating ================================================
-- create_table(:galleries)
NOTICE: CREATE TABLE will create implicit sequence "galleries_id_seq1" for serial column "galleries.id"
# My lazy aliases
alias desktop="cd ~/Desktop && ll"
alias bashrc="mate ~/.bash_profile"
alias restart="sudo shutdown -r now"
alias hosts="mate /etc/hosts"
alias code="cd ~/code"
#Rails aliases
alias ss="script/server"
alias sc="script/console"
@graybill
graybill / gist:880112
Created March 21, 2011 20:09
redcar install error
> brew install redcar
/usr/bin/git
==> Cloning git://github.com/danlucraft/redcar.git
Updating /Users/admin/Library/Caches/Homebrew/redcar--git
You need the RSpec gem installed under JRuby or this will not work.
==> jruby bin/redcar install
==> jruby -S rake build
(in /private/tmp/homebrew-redcar-HEAD-nLMT)
rake aborted!
RubyGem version error: rspec(2.5.0 not < 2.0)
> brew doctor
We couldn't detect gcc 4.0.x. Some formulae require this compiler.
You changed your cc to symlink to llvm.
This bypasses LLVM checks, and some formulae may mysteriously fail to work.
You may want to change /usr/bin/cc to point back at gcc.
To force Homebrew to use LLVM, you can set the "HOMEBREW_USE_LLVM" environmental
variable, or pass "--use-llvm" to "brew install".
@graybill
graybill / gitconfig
Created April 5, 2011 20:12
gitconfig
[alias]
co = checkout
ci = commit
st = status
pu = push
pl = pull
pub = "!f() { git push ${1:-origin} `git symbolic-ref HEAD`; }; f"
[user]
email = [email protected]
name = Linus Graybill
require 'csv'
def coordinates(addr)
include Geokit::Geocoders
res=MultiGeocoder.geocode(addr)
res.ll
end
namespace :import do
desc 'Parse CSV files and import into the database'
def self.coordinates(addr)
include Geokit::Geocoders
res=MultiGeocoder.geocode(addr)
r = res.ll.split(',')
[r[0].to_f, r[1].to_f]
end
def self.create(params = nil)
loc = coordinates(params[:address1] + "+PA+" + params[:zipcode])
super
class Location
include MongoMapper::Document
scope :restaurants, where(:loc_type => 'restaurant')
scope :bars, where(:loc_type => 'bar')
scope :trucks, where(:loc_type => 'truck')
key :name, String, :required => true
key :store_no, Integer
key :address1, String