Skip to content

Instantly share code, notes, and snippets.

View christos's full-sized avatar

Christos Zisopoulos christos

View GitHub Profile
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
#!/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
@christos
christos / irpf.rb
Last active August 29, 2015 14:14 — forked from fxn/irpf.rb
# 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,
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
@christos
christos / gist:34336
Created December 10, 2008 14:34
Cucumber + Selenium
#
# 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
#
# 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
#
# 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
ActionView::Helpers::AssetTagHelper.register_javascript_expansion({
html5shiv: "http://html5shiv.googlecode.com/svn/trunk/html5.js",
ie7js: "http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js",
ie8js: "http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js",
jquery: "http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"
})
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@christos
christos / gist:459765
Created July 1, 2010 09:29 — forked from defunkt/gist:132456
Bash snippet to open new shells in most recently visited dir.
# Bash snippet to open new shells in most recently visited dir.
# Useful if you want to open a new terminal tab at the present
# tab's location.
#
# Put this in your .bashrc or whatever.
pathed_cd () {
if [ "$1" == "" ]; then
\cd
else