- Start a Sinatra server on port 4000
- GET / to that server triggers a
git pulland mod_rails restart - Hit port 4000 locally after pushing
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
| ' Copyright (c) 2007, Tony Ivanov | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright | |
| notice, this list of conditions and the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright | |
| notice, this list of conditions and the following disclaimer in the | |
| documentation and/or other materials provided with the distribution. |
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
| # | |
| # = Capistrano database.yml task | |
| # | |
| # Provides a couple of tasks for creating the database.yml | |
| # configuration file dynamically when deploy:setup is run. | |
| # | |
| # Category:: Capistrano | |
| # Package:: Database | |
| # Author:: Simone Carletti <[email protected]> | |
| # Copyright:: 2007-2010 The Authors |
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://www.jamesbritt.com/2007/12/18/sending-mail-through-gmail-with-ruby-s-net-smtp | |
| # http://d.hatena.ne.jp/zorio/20060416 | |
| require "openssl" | |
| require "net/smtp" | |
| Net::SMTP.class_eval do | |
| private | |
| def do_start(helodomain, user, secret, authtype) | |
| raise IOError, 'SMTP session already started' if @started |
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
| # Monitor HTTP requests being made from your machine with a one-liner.. | |
| # Replace "en1" below with your network interface's name (usually en0 or en1) | |
| sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*" | |
| # OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile: | |
| # (again replace "en1" with correct network interface name) | |
| alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"" | |
| # All the above tested only on OS X. |
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
| # this goes in the $HOME dir | |
| # needs mislav-rspactor v0.3.2 and RSpec 1.2 | |
| Rspactor::Runner.class_eval do | |
| class << self | |
| alias old_formatter_opts formatter_opts | |
| def formatter_opts | |
| # update this path to where you saved unicode_formatter.rb | |
| old_formatter_opts + " -r /Users/mislav/Projects/unicode_formatter -f UnicodeFormatter" | |
| 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
| #!/usr/bin/env ruby | |
| # The script that give you focus! | |
| # Create a text file that contains sites want to give yourself | |
| # access to only during certain times of day. | |
| # | |
| # The file will look like this: | |
| # 12 news.ycombinator.com | |
| # 11-13,19-21 twitter.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
| # Grab a password out of the 1Password keychain...finding it by "name" | |
| def password_for_hostname(name) | |
| password_info = `security 2>&1 >/dev/null find-generic-password -gs passwords.Password:#{name} 1Password.keychain` | |
| password = password_info.match(/\"\:\"(.+)\"\}\"/)[1] rescue nil | |
| end |