Skip to content

Instantly share code, notes, and snippets.

@aslam
aslam / post-checkout
Created May 10, 2011 17:37 — forked from robbyrussell/post-checkout
post-checkout hook to reload bundler and restart passenger
#!/bin/sh
#
# Just save this as .git/hooks/post-checkout in your Rails application
#
env ARCHFLAGS="-arch x86_64" bundle install
touch tmp/restart.txt
@aslam
aslam / application.rb
Created December 10, 2010 06:10
Rails 3 reset session using devise (actually not using devise)
class ApplicationController < ActionController::Base
...
before_filter :save_or_clear_session
def save_or_clear_session
if controller_name.eql?('sessions') and action_name.eql?('destroy')
request.reset_session
flash[:notice] = "Signed out successfully."
end
end
var next_path;
var form_stages;
var check_a;
var check_s;
var prev_path;
var field_val;
;(function($) {
var app = new Sammy.Application(function() {
with(this) {
get('#/stage/:id', function() { with(this) {
//get first part of current url, without hash
var base_path = window.location.href.split("#")[0];
var real_id = 0;
var current_page;
;(function($) {
//create new sammy app
var app = new Sammy.Application(function() {
with(this) {
//corresponds to routes like #/slide/1
get('#/slide/:page_id', function() { with(this) {
$(function() {
//run the accordion plugin, set height of sections to height of content
$("#accordion").accordion({ autoHeight: false });
});
;(function($) {
//write new sammy application
var app = new Sammy.Application(function() {
with(this) {
//corresponds to routes such as #/section/1
get('#/section/:section_id', function() { with(this) {
# Helps to organize and structure your tests with
# * human readable test names
# * flagging tests as pending
# * structuring the test implementation with blocks
# Please see the documentation of single methods below.
# Written by Vladimir Dobriakov
# See http://blog.geekq.net/2009/11/25/minimalist-testing-ruby/ for explanation
require 'test/unit'
class << Test::Unit::TestCase