Skip to content

Instantly share code, notes, and snippets.

View cmeiklejohn's full-sized avatar
💭
Always working.

Christopher S. Meiklejohn cmeiklejohn

💭
Always working.
View GitHub Profile
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@kowey
kowey / gist:2420144
Created April 19, 2012 10:29 — forked from cartazio/gist:1655271
Haskell GTK on 64 bit MacOS X

Notes

  • on lion (and snow leopard i suppose), make sure you are using a 64 bit install of ghc. Also, unless you are suggesting an edit to these directions, please go ask people on the relevant mailing list or wiki for help :)
  • Tested on ghc 7.2.2, assumes you have standard developer things installed on mac, like x11 and stuff
  • Also tested on GHC 7.0.4 (Haskell Platform) with XCode 4.3.
  • These notes were originally brought to you by Carter Schonwald; the “I” probably refers to him. Eric Kow will refer to himself in the third person).

GHC 7.4.x

  • gtk2hs 0.12.2 won't build with ghc 7.4.1, but the current darcs repo for gtk2hs does build
@jraines
jraines / rails31init.md
Created May 24, 2011 17:03
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest user
if user.role? :admin
can :manage, :all
else
can :read, :all
@mistersourcerer
mistersourcerer / color.sh
Created October 10, 2012 15:06
Colorizing Ruby [or other lang] code from command line, to paste in keynote
#!/bin/bash
#http://pygments.org/docs/cmdline/
LANG="ruby"
if [ -n "$2" ]
then
LANG=$2;
fi
@jonathansick
jonathansick / pygrtf.sh
Created June 7, 2012 05:10
Pygmentize to RTF and Copy
#!/bin/bash
# From http://emptysquare.net/blog/syntax-highlighting-with-pycharm-pygments-and-keynote/
/usr/local/bin/pygmentize -f rtf -O "style=friendly,fontface=Courier Bold" "$1" | pbcopy
@lynaghk
lynaghk / 0-update.md
Last active July 5, 2022 13:33
Angular.js from ClojureScript
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

Recently, we've been working on extracting Ember conventions from applications we're working on into the framework. Our goal is to make it clearer how the parts of an Ember application work together, and how to organize and bootstrap your objects.

Routing

Routing is an important part of web applications. It allows your users to share the URL they see in their browser, and have the same things appear when their friends click on the link.

The Ember.js ecosystem has several great solutions for routing. But, since it is such an important part of most web applications, we've decided to build it right into the framework.

If you have already modeled your application state using Ember.StateManager, there are a few changes you'll need to make to enable routing. Once you've made those changes, you'll notice the browser's address bar spring to life as you start using your app—just by moving between states, Ember.js will update the URL automatically.

@ericsaboia
ericsaboia / gist:994614
Created May 27, 2011 03:58
Changelog ActiveRecord:Base Rails 3.1
# ActiveRecord::Base#dup and ActiveRecord::Base#clone semantics have changed to closer match normal Ruby dup and clone semantics.
# Calling ActiveRecord::Base#clone will result in a shallow copy of the record, including copying the frozen state. No callbacks will be called.
# Calling ActiveRecord::Base#dup will duplicate the record, including calling after initialize hooks. Frozen state will not be copied, and all associations will be cleared. A duped record will return true for new_record?, have a nil id field, and is saveable.