FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| /* | |
| You can now create a spinner using any of the variants below: | |
| $("#el").spin(); // Produces default Spinner using the text color of #el. | |
| $("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el. | |
| $("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color). | |
| $("#el").spin({ ... }); // Produces a Spinner using your custom settings. | |
| $("#el").spin(false); // Kills the spinner. |
| 1. Use latest build | |
| gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git' | |
| 2. Create an initializer | |
| # /config/initializers/simple_form.rb | |
| # Use this setup block to configure all options available in SimpleForm. | |
| SimpleForm.setup do |config| | |
| # Wrappers are used by the form builder to generate a complete input. | |
| # You can remove any component from the wrapper, change the order or even |
| // Media Queries in Sass 3.2 | |
| // | |
| // These mixins make media queries a breeze with Sass. | |
| // The media queries from mobile up until desktop all | |
| // trigger at different points along the way | |
| // | |
| // And important point to remember is that and width | |
| // over the portrait width is considered to be part of the | |
| // landscape width. This allows us to capture widths of devices | |
| // that might not fit the dimensions exactly. This means the break |
| # Usage: redis-cli publish message hello | |
| require 'sinatra' | |
| require 'redis' | |
| conns = [] | |
| get '/' do | |
| erb :index | |
| end |
| class OmniLog | |
| attr_reader :available | |
| def initialize(path) | |
| @real = Logger.new(path) | |
| @fake = Logger.new("/dev/null") | |
| @available = Set.new | |
| end | |
| def add!(which) |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)This helper has finally been moved into a gem called nav_lynx!
https://github.com/vigetlabs/nav_lynx
http://rubygems.org/gems/nav_lynx
Thanks to @brianjlandau and @reagent for getting that set up and tested!
| # When an RSpec test like this fails, | |
| # | |
| # @my_array.should == [@some_model, @some_model2] | |
| # | |
| # RSpec will call inspect on each of the objects to "help" you figure out | |
| # what went wrong. Well, inspect will usually dump a TON OF SHIT and make trying | |
| # to figure out why `@my_array` is not made up of `@some_model` and `@some_model2`. | |
| # | |
| # This little module and technique helps get around that. It will redefine `inspect` | |
| # if you include it in your model object. |
| sudo add-apt-repository ppa:pitti/postgresql | |
| sudo apt-get update | |
| sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2 | |
| sudo su -l postgres | |
| psql -d template1 -p 5433 | |
| CREATE EXTENSION IF NOT EXISTS hstore; | |
| CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
| service postgresql stop | |
| /usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf" |