Skip to content

Instantly share code, notes, and snippets.

puts 'hello world!'
diff --git a/vendor/plugins/resources_controller/lib/ardes/resources_controller.rb b/vendor/plugins/resources_controller/lib/ardes/resources_co
index 7bd2b61..06affe6 100644
--- a/vendor/plugins/resources_controller/lib/ardes/resources_controller.rb
+++ b/vendor/plugins/resources_controller/lib/ardes/resources_controller.rb
@@ -110,11 +110,11 @@ module Ardes#:nodoc:
#
# You may have a named route that maps a url to a particular controller and action,
# this causes resources_controller problems as it relies on the route to load the
- # resources. You can get around this by specifying :erp as a param in routes.rb
+ # resources. You can get around this by specifying :resource_path as a param in routes.rb
# SUPER DARING APP TEMPLATE 1.0
# By Peter Cooper
# Link to local copy of edge rails
# inside('vendor') { run 'ln -s ~/dev/rails/rails rails' }
# Delete unnecessary files
# run "rm README"
# run "rm public/index.html"
# run "rm public/favicon.ico"
class Configuration
attr_accessor :tail_logs, :max_connections, :admin_password, :app_server
class AppServer
attr_accessor :port, :admin_password
end
def initialize
@app_server = AppServer.new
end
@jlsync
jlsync / file.js
Created May 14, 2010 11:57 — forked from quirkey/file.js
sammy.js get routes without changing the url / location hash
$.sammy(function() {
app.get('#/exams/new', function(context) {
// display the modal
window.setTimeout( function(){
context.app.location_proxy.unbind();
context.app.setLocation('#/');
context.app.last_location = '#/';
class Jlproxy
def initialize(app)
@app = app
end
def call(env)
s = StringIO.new
$> = s
PP::pp env;
@jlsync
jlsync / Javascript MVC for Ruby-on-Rails.txt
Created June 17, 2010 09:09
Javascript MVC patterns and implementations
http://blog.new-bamboo.co.uk/2010/1/26/why-your-javascript-apps-need-more-structure
http://blog.new-bamboo.co.uk/2010/2/4/let-them-eat-state
http://blog.new-bamboo.co.uk/2010/3/7/the-js-model-layer
http://blog.new-bamboo.co.uk/2010/2/8/rendering-views-in-javascript
Controllers:
http://code.quirkey.com/sammy/ - Sammy is a tiny javascript framework built on top of jQuery. It’s RESTful Evented JavaScript.
@jlsync
jlsync / gist:824610
Created February 13, 2011 11:27
control.coffee
$ = jQuery
$window = $(window)
# closure globals
current_state = {}
$selected = null
states = {}
# callbacks...
# load libraries
require 'rubygems'
extras = []
failed = []
# Wirble is for colors in irb
begin
require 'wirble'
Wirble.init
Wirble.colorize
@jlsync
jlsync / prawn_wrapped.rb
Created June 30, 2011 19:01
How to prevent prawn wrap_by_char? charred.pdf
#!/usr/bin/env ruby
require 'rubygems'
require 'prawn'
@pdf = Prawn::Document.new
x = 0
texts = [ "alexander", "the alexander", "the alexander building" ]
texts.each do |text|