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
~/workspace/kongregate (comment_ratings) $>git diff vendor/ | |
diff --git a/vendor/gems/rack-1.0.1/lib/rack/utils.rb b/vendor/gems/rack-1.0.1/lib/rack/utils.rb | |
index d54c928..4614d95 100644 | |
--- a/vendor/gems/rack-1.0.1/lib/rack/utils.rb | |
+++ b/vendor/gems/rack-1.0.1/lib/rack/utils.rb | |
@@ -22,7 +22,7 @@ module Rack | |
def unescape(s) | |
s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){ | |
[$1.delete('%')].pack('H*') | |
- } |
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 | |
set -u | |
set -e | |
# Example init script, this can be used with nginx, too, | |
# since nginx and unicorn accept the same signals | |
# Feel free to change any of the following variables for your app: | |
APP_ROOT=/k/app_name/current | |
PID=/var/run/unicorn/unicorn.pid | |
ENV=production |
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
check process unicorn | |
with pidfile /var/run/unicorn/unicorn.pid | |
start program = "/etc/init.d/unicorn start" | |
stop program = "/etc/init.d/unicorn stop" | |
if mem is greater than 300.0 MB for 1 cycles then restart # eating up memory? | |
if cpu is greater than 50% for 2 cycles then alert # send an email to admin | |
if cpu is greater than 80% for 3 cycles then restart # hung process? | |
group unicorn |
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
check process unicorn_worker_5000 | |
with pidfile /var/run/unicorn/unicorn.5000.pid | |
start program = "/bin/true" | |
stop program = "/etc/init.d/unicorn kill_worker 5000" | |
if mem is greater than 300.0 MB for 1 cycles then restart | |
if cpu is greater than 80% for 3 cycles then restart | |
group unicorn_workers |
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
after_fork do |server, worker| | |
port = 5000 + worker.nr | |
child_pid = server.config[:pid].sub('.pid', ".#{port}.pid") | |
system("echo #{Process.pid} > #{child_pid}") | |
end |
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 ImageSqueeze | |
class OptiPNGProcessor < Processor | |
def self.input_type | |
PNG | |
end | |
def self.squeeze(filename, output_filename) | |
system("optipng -i1 -o7 #{filename} -out=#{output_filename} > /dev/null") | |
end | |
end |
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
for each row in the height | |
for each space in the width | |
draw an X |
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
alias oops="rfind breakpoint; rfind debugger" | |
function rfindhelper () { | |
find $1 -name '*.rb' -o -name '*.rhtml' -o -name '*.erb' -o -name '*.rjs' -o -name '*.builder' -o -name '*.js' | xargs grep -i "$2" | |
} | |
function rfind () { | |
rfindhelper "app config test lib" "$*" | |
} | |
function rfindrails () { | |
rfindhelper "vendor/rails" "$*" |
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
alias oops="rfind breakpoint; rfind debugger" | |
function rfindhelper () { | |
find $1 -name '*.rb' -o -name '*.rhtml' -o -name '*.erb' -o -name '*.rjs' -o -name '*.builder' -o -name '*.js' | xargs grep -i "$2" | |
} | |
function rfind () { | |
rfindhelper "app config test lib" "$*" | |
} | |
function rfindrails () { | |
rfindhelper "vendor/rails" "$*" |
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 | |
# Check if any submodule has been updated in HEAD after a merge (or | |
# pull) or a branch checkout. If so, ask if user wants to run | |
# git-submodule update. | |
# --Chaitanya Gupta | |
SCRIPT_NAME=$(basename "$0") | |
if [[ "$SCRIPT_NAME" = "post-checkout" && "$1" = "$2" || "$3" = "0" ]]; then |
OlderNewer