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
require 'rubygems' | |
require 'rest_client' | |
require 'json' | |
watcher_threshold = 50 | |
user = "vim-scripts" | |
results = [] | |
url = "http://github.com/api/v2/json/repos/search/vim" | |
# url = "http://github.com/api/v2/json/repos/show/#{user}" |
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
From a948c13b7073af9a0af4e3615cf4a245056a42f2 Mon Sep 17 00:00:00 2001 | |
From: Jinzhu <[email protected]> | |
Date: Sun, 26 Feb 2012 23:34:58 +0800 | |
Subject: [PATCH] support pass variables from routes to handler | |
--- | |
route.go | 18 ++++++++++++++++++ | |
1 file changed, 18 insertions(+) | |
diff --git a/route.go b/route.go |
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
require 'rubygems' | |
gem 'mail', '=2.2.19' | |
require 'mail' | |
require 'nkf' | |
module Mail | |
module Encodings | |
class SevenBit | |
def self.decode(str) |
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 have been added to fully maintain nginx, unicorn, redis, memcached, start resque workers and run any command on any server in the farm. | |
#<pre> | |
#cap nginx:restart # Restart Nginx. | |
#cap nginx:start # Start Nginx. | |
#cap nginx:status # Status of Nginx. | |
#cap nginx:stop # Stop Nginx. | |
#cap nginx:tail_error # Tail the Nginx error logs. | |
#cap unicorn:reload # reload your unicorn servers. | |
#cap unicorn:restart # restart your unicorn servers. | |
#cap unicorn:start # start your unicorn servers. |
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 | |
cp $1 $1.tmp | |
## Remove the old gz if there is one | |
rm -rf $1.gz | |
## Compress the tmp HTML copy. Use the highest level 9 | |
## compression and do not store dates or file names | |
## in the gzip header. BTW, if the compressed gz is | |
## larger then the original file a gzip will NOT be made. |
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
while true | |
do | |
sleep 0.5 | |
if [ -f /dev/sdj ]; then | |
echo `date` > SdjMountedAt | |
sudo mount /dev/sdj /mnt/DATA | |
sudo /etc/init.d/httpd start | |
sudo /etc/init.d/mysqld start | |
cd /mnt/DATA/mysql-server-tritonn; sudo ./bin/mysqld_safe & | |
sudo su postgres -c '/usr/local/pgsql/bin/pg_ctl -D /mnt/DATA/pgsql -l /mnt/DATA/pgsql/log start' |
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/bash | |
# [email protected] | |
# thanks sushiyant ([email protected]) | |
pacman -S iptables pptpd | |
echo "iptables -A INPUT -i ppp+ -j ACCEPT" >> /etc/rc.local | |
echo "iptables -A OUTPUT -o ppp+ -j ACCEPT" >> /etc/rc.local | |
echo "iptables -A INPUT -p tcp --dport 1723 -j ACCEPT" >> /etc/rc.local | |
echo "iptables -A INPUT -p 47 -j ACCEPT" >> /etc/rc.local |
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
keyBindings = (function(){ | |
var keyId = { | |
"U+0008" : "BackSpace", | |
"U+0009" : "Tab", | |
"U+0018" : "Cancel", | |
"U+001B" : "Esc", | |
"U+0020" : "Space", | |
"U+0021" : "!", | |
"U+0022" : "\"", | |
"U+0023" : "#", |
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
require 'geoip' | |
module Rack | |
# Rack::GeoIPCountry uses the geoip gem and the GeoIP database to lookup the country of a request by its IP address | |
# The database can be downloaded from: | |
# http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | |
# | |
# Usage: | |
# use Rack::GeoIPCountry, :db => "path/to/GeoIP.dat" | |
# |
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
# See also http://github.com/simonjefford/rack_firebug_logger | |
# for this middleware + tests + a rails plugin | |
class FirebugLogger | |
def initialize(app, options = {}) | |
@app = app | |
@options = options | |
end | |
def call(env) | |
dup._call(env) |