View gems_list_without_versions.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
#!/usr/bin/env ruby | |
puts `gem list`.split("\n").map{ |gem_with_version| gem_with_version[/^.*?(?= )/] }.join("\n") |
View ligament.min.js
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
/* Copyright (C) 2011 by Yehuda Katz | MIT */ | |
M={},V={},C={}; |
View unicorn.rake
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
# Tasks for managing Unicorn instances of a Rails application. | |
# Compatible with Ruby >= 1.9.2 and Rails >= 2 . | |
# Unicorn signals: http://unicorn.bogomips.org/SIGNALS.html | |
namespace :unicorn do | |
class UnicornPIDError < StandardError; end | |
def rails_env | |
Rails.env |
View .Xmodmap
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
! Direttive per mappare correttamente la tastiera Apple italiana su Ubuntu, | |
! cioè, correggere lo scambio dei tasti maggiore/minore con quello di backslash/pipe | |
! | |
! 49: codice del tasto maggiore/minore ( <> ) (situato a destra del tasto L-SHIFT) | |
! 94: codice del tasto backslash/pipe ( \| ) (collocato a sinistra del tasto `uno/punto esclamativo` ( 1! ) ) | |
! | |
! | |
! I comandi scritti sotto, eseguiti da terminale sono: | |
! xmodmap -e "keycode 49 = less greater guillemotleft guillemotright guillemotleft guillemotright" && \ | |
! xmodmap -e "keycode 94 = backslash bar notsign brokenbar notsign brokenbar" |
View rails_3_template.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
#!/usr/bin/env ruby -w | |
# | |
# Rails 3 template (Postgres, RSpec, Capybara, Guard/libnotify4Linux, Spork) | |
# This should be used in this way: | |
# | |
# rails new APP_NAME -d postgresql -T --skip-bundle -m https://raw.github.com/gist/2489048/rails_3_template.rb | |
# 1. Non-SSL source proposal (due to bundler bug) | |
if yes?("Do you want to use the non-SSL source of rubygems.org as gems source?") | |
# run %q(sed -i 's/https:\/\/rubygems.org/http:\/\/rubygems.org/' Gemfile) |
View rock_paper_scissors.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
class RockPaperScissors | |
ITEMS = %W(A P B N) | |
def self.compare(item, other_item) | |
new(item).compare other_item | |
end | |
def initialize(item) |
View unicorn_init_script.sh
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: unicorn | |
# Required-Start: $all | |
# Required-Stop: $network $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the unicorn instances | |
# Description: starts the unicorn server instances using start-stop-daemon | |
# |
View delayed_job_init_script.sh
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: delayed_job | |
# Required-Start: $all | |
# Required-Stop: $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the delayed_job instances | |
# Description: starts the delayed_job server instances using start-stop-daemon | |
# |
View delayed_job_init_script.sh
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: delayed_job | |
# Required-Start: $all | |
# Required-Stop: $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the delayed_job instances | |
# Description: starts the delayed_job server instances using start-stop-daemon | |
# |
View schedule.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
# Schedule script for using Whenever toghether with rbenv | |
# | |
# Whenever: https://github.com/javan/whenever | |
# rbenv: https://github.com/sstephenson/rbenv | |
set :env_path, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"' | |
# doesn't need modifications | |
# job_type :command, ":task :output" |
OlderNewer