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") |
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={}; |
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 |
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" |
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) |
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) |
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 | |
# |
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 | |
# |
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 | |
# |
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