This file contains hidden or 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
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential | |
apt-get -y install git-core | |
# Install rbenv | |
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
# Add rbenv to the path: |
This file contains hidden or 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
# === Terminal.app === # | |
# Open new tab in terminal. | |
exec("osascript -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' > /dev/null 2>&1 ") | |
# Open directory | |
exec("osascript -e 'tell application \"Terminal\" to do script \"cd directory\" in selected tab of the front window' > /dev/null 2>&1 ") | |
# Open directory in new tab (this is better) | |
exec("osascript -e 'tell application \"Terminal\"' -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' -e 'do script with command \"cd directory && clear\" in selected tab of the front window' -e 'end tell' > /dev/null 2>&1") |
This file contains hidden or 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
lt: | |
devise: | |
confirmations: | |
confirmed: "Jūsų vartotojas sėkmingai patvirtintas. Dabar jūs esate prisijungę." | |
send_instructions: "Už keletos minučių el. paštu gausite instrukcijas, kaip patvirtinti savo vartotoją." | |
send_paranoid_instructions: "Jei jūsų el. pašto adresas yra mūsų duomenų bazėje, kelių minučių bėgyje gausite laišką su patvirtinimo instrukcijomis." | |
failure: | |
already_authenticated: "Jūs jau esate prisijungęs." | |
inactive: "Jūsų vartotojas dar nepatvirtintas." | |
invalid: "Neteisingas el. paštas arba slaptažodis." |
This file contains hidden or 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 | |
# reviewed by Erik B on January 21 2012 | |
# by @tapbot_paul | |
# Don't blame me if this nukes your metadata, formats your drive, kills your kids | |
# This script goes through any iCloud Matched songs in your iTunes library and tries to update the | |
# metadata from the iTunes Store | |
# Will run against selected tracks or if nothing selected entire library | |
# install the required gems with the following commands | |
# sudo gem install json --no-ri --no-rdoc | |
# sudo gem install rb-appscript --no-ri --no-rdoc |
This file contains hidden or 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
# app/controllers/users/password_controller.rb | |
class Users::PasswordsController < Devise::PasswordsController | |
def resource_params | |
params.require(:user).permit(:email, :password, :password_confirmation) | |
end | |
private :resource_params | |
end |
This file contains hidden or 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
# Automatically add mustaches to any images it can | |
# | |
# | |
module.exports = (robot) -> | |
robot.hear /^(https?:\/\/[^ #]+\.(?:png|jpg|jpeg))(?:[#]\.png)?$/i, (msg) -> | |
src = msg.match[1] | |
unless src.match(/^http:\/\/mustachify.me/) | |
msg.http("http://stacheable.herokuapp.com") |
This file contains hidden or 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
# Utility commands surrounding Hubot uptime. | |
spawn = require('child_process').spawn | |
module.exports = (robot) -> | |
robot.hear /hubot (who|where) are you\??/i, (msg) -> | |
msg.finish() | |
child = spawn('/bin/sh', ['-c', "echo I\\'m $LOGNAME@$(hostname):$(pwd) \\($(git rev-parse HEAD)\\)"]) | |
child.stdout.on 'data', (data) -> | |
msg.send "#{data.toString().trim()} running node #{process.version} [version: #{robot.version}, pid: #{process.pid}, name: #{robot.name} ]" |
This file contains hidden or 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
def run! | |
pid = fork do | |
exec_pid = fork do | |
$0 = "heaven[#{Heaven.current_sha}] : executing deployment of #{application_name}" | |
out_file = File.new(log, "w") | |
STDIN.reopen("/dev/null") | |
STDOUT.reopen(out_file) | |
STDERR.reopen(out_file) |
This file contains hidden or 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://unicorn.bogomips.org/SIGNALS.html | |
namespace :unicorn do | |
task :start, :roles => :app do | |
sudo "god start unicorn" | |
end | |
task :stop, :roles => :app do | |
sudo "god stop unicorn" | |
end |
NewerOlder