Skip to content

Instantly share code, notes, and snippets.

Avatar
👻

Ryan Cook cookrn

👻
View GitHub Profile
View action.rb
# it's not critical for understanding
# but here is the associated server-side action
#
def version
@program = load_program!
@version = @program.versions.find(params[:version_id])
if stale?(:last_modified => @version.updated_at, :etag => @version.cache_key)
render
View context.md
@cookrn
cookrn / ruby_version.out
Created Nov 21, 2012
`bundle install` with OJ gem fails on jruby-1.7.0
View ruby_version.out
jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on Java HotSpot(TM) 64-Bit Server VM 1.6.0_29-b11-402-11D50b [darwin-x86_64]
@cookrn
cookrn / ruby_version.out
Created Nov 21, 2012
`bundle install` with OJ gem fails on jruby-1.7.0
View ruby_version.out
jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on Java HotSpot(TM) 64-Bit Server VM 1.6.0_29-b11-402-11D50b [darwin-x86_64]
@cookrn
cookrn / example.rb
Created Nov 19, 2012
Rough shot at what some Lattice Cell code might look like
View example.rb
require 'lattice'
class ApplicationCell
include Lattice::Cell
# Other custom stuff
end
class Person < Struct.new( :name , :birthday )
end
@cookrn
cookrn / quiz-1.md
Created Sep 27, 2012 — forked from ahoward/quiz-1.md
quiz-1.md
View quiz-1.md
So you think you wanna be a web developer...

Fork this, update your copy with answers.

They don't need to be precise - pseudo-code is fine in most cases.

Some questions don't have correct answers.

@cookrn
cookrn / _readme.md
Created Jun 27, 2012
Compile *.ejs Templates
View _readme.md

EJS Compiler

This is used to generate a templates.js file where the keys are template identifiers and the values are the raw, escaped EJS templates.

Templates are semi-compiled server side. Results of compilation are memoized on the client side using Underscore.

This is useful for maintaining multiple template files server-side and compiling them into a client-side script.

This requires the use of the ejs client side library. Requires ejs to be available on window. See: https://github.com/visionmedia/ejs#client-side-support

@cookrn
cookrn / out.txt
Created Jun 23, 2012
RVM 1.9.3 Ubuntu 12.04 Yaml Make Error
View out.txt
$ cat /usr/local/rvm/log/ruby-1.9.3-p194/yaml/make.log
[2012-06-23 05:51:12] make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /usr/local/rvm/src/yaml-0.1.4/config/missing --run aclocal-1.11
cd . && /bin/bash /usr/local/rvm/src/yaml-0.1.4/config/missing --run automake-1.11 --foreign
src/Makefile.am:2: Libtool library used but `LIBTOOL' is undefined
src/Makefile.am:2: The usual way to define `LIBTOOL' is to add `LT_INIT'
src/Makefile.am:2: to `configure.ac' and run `aclocal' and `autoconf' again.
src/Makefile.am:2: If `LT_INIT' is in `configure.ac', make sure
src/Makefile.am:2: its definition is in aclocal's search path.
make: *** [Makefile.in] Error 1