This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
From a question about DSLs.
See:
The code in the Adventure::Room
class could be made a little cleaner using a gem like fattr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'lattice' | |
class ApplicationCell | |
include Lattice::Cell | |
# Other custom stuff | |
end | |
class Person < Struct.new( :name , :birthday ) | |
end |
Couldn't find the text of this for a while...
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.
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |