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
Cool Gist for the web |
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
SET INPUT VALUE BY ID | |
--------------------- | |
$('input[id=' + id + ']').attr('value', ""); | |
CURRENT SELECT / OPTIONS | |
------------------------- | |
$('form#new_image select[id=image_modality] :selected').attr('value') | |
CURRENT CHECKBOX CHECKED | |
------------------------- |
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
Capistrano::Configuration.instance(:must_exist).load do | |
before 'deprec:ree:symlink_ree' do | |
sudo "test -L #{ree_short_path} && sudo unlink #{ree_short_path} || true" | |
end | |
namespace :deprec do | |
namespace :ree do | |
set :ree_version, 'ruby-enterprise-1.8.7-2010.01' |
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
# I want to define access levels with: | |
# ActionController::Base.define_access_level(:reporter, 9) | |
module Dougo | |
module MyExtensionToClass | |
def self.included(base) | |
base.class_eval do | |
extend ClassMethods | |
end |
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
#!/opt/local/bin/ruby -w | |
# | |
# run this script in the gem direcory with the | |
# example bam ~/Workspace/my_rails_project [name] | |
# | |
# /rails_generators/manifests/NAME.yml | |
# | |
# contents : | |
# - app/views/admin/users | |
# - app/views/user_mailer |
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
#!/opt/local/bin/ruby -w | |
# git clone http://github.com/jjl/get_iplayer.git ~/Workspace/bin/get_iplayer/get_iplayer | |
# curl http://ftp.twaren.net/Unix/NonGNU/flvstreamer/macosx/flvstreamer_macosx_intel_32bit_latest --output ~/Workspace/bin/flvstreamer | |
# chmod 755 ~/Workspace/bin/flvstreamer | |
GET_IPLAYER = "~/Workspace/bin/get_iplayer/get_iplayer" | |
IPLAYER_CACHE = "~/.get_iplayer/radio.cache" | |
IPLAYER_HISTORY = "~/.get_iplayer/download_history" | |
FLVSTREAMER = "~/Workspace/bin/flvstreamer" | |
DOWNLOAD_PATH = "~/Music/BBC" |
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
# FINDING AD VIEWS | |
# klass = AdView | |
# klass = klass.by_campaign_id(@campaign.id) | |
# klass = klass.order_event_time('DESC') | |
# | |
# @ad_views = klass.paginate(:page => params[:page], :per_page => 100 ) | |
# | |
# CREATING AD VIEWS | |
# AdView.by_activated_campaign_id(@campaign.id]).create(: ... ) | |
# |
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
<%- | |
start_date = @trip.start_date; | |
location_map = @locations.map do | location | | |
map = { | |
:start_date => format_date(start_date), | |
:location_id => location.id, | |
:position => location.position, | |
:title => location.title, | |
:nights => location.nights, | |
:latlng => location.latlng, |
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 'spec_helper' | |
describe "routing to profiles" do | |
extend RulesEngine::RouteMatcher | |
describe "/re_plans" do | |
# index methods | |
match_route(:get, :re_plans, :index => '/re_plans') | |
match_route(:get, :re_plans, :new => '/re_plans/new') | |
match_route(:post, :re_plans, :create => '/re_plans') |
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
#################################################### | |
# this file belongs in the ./spec/support directory | |
#################################################### | |
require 'rspec/core/formatters/base_formatter' | |
class Frogger < RSpec::Core::Formatters::BaseFormatter | |
COLOR_START = "\e[34m" # blue | |
COLOR_FAILED = "\e[31m" # red | |
COLOR_PASSED = "\e[32m" # green |
OlderNewer