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
build_package_reconfigure() { | |
test -f configure || autoconf | |
} | |
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/01-current-2.1.1-fixes.patch | |
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/02-zero-broken-tests.patch | |
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/03-improve-gc-stats.patch |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: haproxy | |
# Required-Start: $local_fs $network $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: fast and reliable load balancing reverse proxy | |
# Description: This file should be used to start and stop haproxy. | |
### END INIT INFO |
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
# Usage: | |
# | |
# ruby irpf.rb tax_base | |
# | |
# Example: | |
# | |
# ruby irpf.rb 65300 | |
# 65300 €, 22722 €, 34.8% | |
# | |
# Where 22,722 € is the IRPF to pay, and 34.8% is the real rate, that is, |
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 ActiveRecord::Base | |
@@cache_store = nil | |
def self.cache_store | |
@@cache_store ||= ActionController::Base.cache_store | |
end | |
def self.caches(method_name, key = nil, options = {}, &block) | |
if key.is_a?(Hash) | |
options = key | |
key = nil |
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
# | |
# cucumber.yml | |
# | |
# Filter which features are run with each profile by the file extension | |
webrat: --require features/steps/common --require features/support/webrat_env.rb --exclude selenium.feature --format progress | |
selenium: --require features/steps/common --require features/support/selenium_env.rb --exclude webrat.feature --format progress | |
# | |
# features/support/env.rb |
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
# | |
# cucumber.yml | |
# | |
# Filter which features are run with each profile by the file extension | |
webrat: --require features/steps/common --require features/support/webrat_env.rb --exclude selenium.feature --format progress | |
selenium: --require features/steps/common --require features/support/selenium_env.rb --exclude webrat.feature --format progress | |
# | |
# features/support/env.rb |
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
# | |
# cucumber.yml | |
# | |
# Filter which features are run with each profile by the file extension | |
webrat: --require features/steps/common --require features/support/webrat_env.rb --exclude selenium.feature --format progress | |
selenium: --require features/steps/common --require features/support/selenium_env.rb --exclude webrat.feature --format progress | |
# | |
# features/support/env.rb |
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
# mailer_twitterable/lib/supercoco9/mailer_twitterable.rb | |
module Supercoco9 | |
module MailerTwitterable | |
def self.included(base) | |
base.extend ClassMethods | |
base.include InstanceMethods | |
end | |
module ClassMethods | |
def deliver_with_twitterable!(mail=@mail) | |
# ... your code here |
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
http://oreilly.com/catalog/9780596521264/ | |
http://oreilly.com/catalog/9780596523008/ | |
http://oreilly.com/catalog/9780596529260/ | |
http://pragprog.com/titles/ahptl/pragmatic-thinking-and-learning | |
http://pragprog.com/titles/ppmetr/metaprogramming-ruby | |
http://savethepixel.org | |
http://www.amazon.co.uk/Code-Generation-Action-Jack-Herrington/dp/1930110979 | |
http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 | |
http://www.amazon.com/Defensive-Design-Web-improve-messages/dp/073571410X | |
http://www.amazon.com/Design-Patterns-Ruby-Addison-Wesley-Professional/dp/0321490452 |
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.ajaxSetup({ | |
'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript");} | |
}); | |
$('a[data-remote="true"]').live('click', function(e) { | |
var $link = $(this); | |
var method = $link.attr('data-method') || 'get'; | |
var url = $link.attr('href'); | |
var type = (method == 'get') ? 'GET' : 'POST'; |
OlderNewer