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
@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

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.

@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
@randysecrist
randysecrist / gist:1994620
Created March 7, 2012 17:41
osx-gcc-installer, erlang r14b04, os x 10.7.3
cc -o prlink.o -c -m32 -Wall -fno-common -pthread -O2 -fPIC -UDEBUG -DNDEBUG=1 -DXP_UNIX=1 -DDARWIN=1 -DHAVE_BSD_FLOCK=1 -DHAVE_SOCKLEN_T=1 -DXP_MACOSX=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_ -I../../../dist/include/nspr -I../../../pr/include -I../../../pr/include/private -I/Developer/Headers/FlatCarbon prlink.c
prlink.c:48:27: error: CodeFragments.h: No such file or directory
prlink.c:49:23: error: TextUtils.h: No such file or directory
prlink.c:50:19: error: Types.h: No such file or directory
prlink.c:51:21: error: Aliases.h: No such file or directory
prlink.c:52:19: error: CFURL.h: No such file or directory
prlink.c:53:22: error: CFBundle.h: No such file or directory
prlink.c:54:22: error: CFString.h: No such file or directory
prlink.c:55:26: error: CFDictionary.h: No such file or directory
prlink.c:56:20: error: CFData.h: No such file or directory
dir = File.expand_path("..", __FILE__)
require File.join(dir, "redis_protocol")
require 'pp'
class APIFront
GEM_STORE = "http://production.s3.rubygems.org"
@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.

gem install showoff
git clone git://github.com/brixen/presentations.git
cd presentations/rubyconf11
showoff serve
@josevalim
josevalim / rbx_partial_application.diff
Created September 17, 2011 20:59
Partial application on rubinius. Apply the diff to rubinius project and run `rake build`. Idea by @josevalim, code by @wycats.
diff --git a/lib/compiler/ast/transforms.rb b/lib/compiler/ast/transforms.rb
index 19e1cfb..4e52ec2 100644
--- a/lib/compiler/ast/transforms.rb
+++ b/lib/compiler/ast/transforms.rb
@@ -59,6 +59,71 @@ module Rubinius
end
end
+ # Provide an underscore node that allows partial application in Ruby.
+ # Instead of doing a method call, we are going to generate a lambda
Stacktrace:
[~/Sites/app] cucumber
Using the default profile...
undefined method `javascript_driver=' for Capybara:Module (NoMethodError)
/Users/pma/Sites/app/features/support/env.rb:10:in `block in <top (required)>'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0.rc9/lib/spork.rb:24:in `prefork'
/Users/pma/Sites/app/features/support/env.rb:4:in `<top (required)>'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/rb_support/rb_language.rb:143:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
@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