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
class Foo | |
private | |
def self.hello | |
puts "hi" | |
end | |
end | |
Foo.hello # => "hi" | |
class Bar |
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
class Array | |
def second | |
self[1] | |
end | |
def third | |
self[2] | |
end | |
def forth |
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
jQuery(function($){ | |
$(".default_text") | |
.focus(function(event){ | |
if(this.value == this.defaultValue) { | |
this.value = ""; | |
} | |
}) | |
.blur(function(event){ | |
if(this.value == "") { | |
this.value = this.defaultValue; |
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
$ ./script/plugin install git://github.com/tobi/delayed_job.git | |
removing: /Users/eric/src/project/vendor/plugins/delayed_job/.git | |
Initialized empty Git repository in /Users/eric/src/project/vendor/plugins/delayed_job/.git/ | |
remote: error: /data/git/repositories/7/70/7b/79/taylorbarstow/delayed_job.git/objects: ignoring alternate object stores, nesting too deep. | |
remote: error: /data/git/repositories/2/27/f6/0c/artofmission/delayed_job.git/objects: ignoring alternate object stores, nesting too deep | |
remote: error: /data/git/repositories/7/f4/e9/79/dsander/delayed_job.git/objects: ignoring alternate object stores, nesting too deep. | |
remote: error: /data/git/repositories/0/8c/2c/dd/vandrijevik/delayed_job.git/objects: ignoring alternate object stores, nesting too deep. | |
remote: error: /data/git/repositories/2/25/2c/2b/dhh/delayed_job.git/objects: ignoring alternate object stores, nesting too deep. | |
remote: error: /data/git/repositories/1/1c/e1/f4/joshknowles/delayed_job.git/objects: ignoring alternate object |
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 'rails_generator/secret_key_generator' | |
module TokenGenerator | |
def generate_token(size = 32, &validity) | |
constant = "#{self.class.name}#{id}" | |
generator = Rails::SecretKeyGenerator.new(constant) | |
begin | |
token = generator.generate_secret.first(size) | |
end while !validity.call(token) if block_given? |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'daemons' | |
RAILS_ROOT = File.expand_path(File.join(File.dirname($0), '..')) | |
options = { | |
:dir_mode => :normal, | |
:dir => File.join(RAILS_ROOT, %w(tmp pids)), |
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 | |
# Lifted from: | |
# http://github.com/vigetlabs/viget_deployment/tree/master/recipes/campfire.rb | |
begin | |
require 'rubygems' | |
require 'uri' | |
require 'tinder' | |
namespace :campfire do | |
after "deploy", "campfire:notify" |
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
// ==UserScript== | |
// @name dashup-v2 | |
// @namespace http://sevenscale.com | |
// @description Automatically update dash once a minute | |
// @include https://dash.fiveruns.com/reports/* | |
// @author Eric Lindvall <[email protected]> | |
// ==/UserScript== | |
(function () { | |
var updateElements = function() { |
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
#!/usr/bin/env ruby | |
require 'httparty' | |
require 'active_support' | |
class Tender | |
include HTTParty | |
format :json | |
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
<div class="header_wrapper"> | |
<div class="header clearfix"> | |
<h1><a href="/">Kashless</a></h1> | |
<ul class="menu"> | |
<li><%= link_to "Find a free item", listings_path %></li> | |
<li><%= link_to "Give Away", new_listing_path %></li> | |
<%- if logged_in? && current_user.has_role?(:admin) -%> | |
<li><%= link_to "Users Admin", admin_users_path %></li> | |
<li><%= link_to "Invitations Admin", admin_invitations_path %></li> |