Skip to content

Instantly share code, notes, and snippets.

View alcides's full-sized avatar

Alcides Fonseca alcides

View GitHub Profile
@alcides
alcides / AdiumStatus.scpt
Created October 12, 2009 20:07
Get the status of Adium
tell application "Adium"
get title of status of first account
end tell
@alcides
alcides / gist:217265
Created October 23, 2009 23:22
Install Nginx with Passenger and HTTP Push module.
# Install Nginx with Passenger and HTTP Push module.
# Download Nginx:
cd ~/tmp
wget http://sysoev.ru/nginx/nginx-0.8.20.tar.gz
tar xvfz nginx-0.8.20.tar.gz
# Download Nginx HTTP Push Module
diff --git a/lib/phusion_passenger/wsgi/request_handler.py b/lib/phusion_passenger/wsgi/request_handler.py
index b062807..da081bc 100755
--- a/lib/phusion_passenger/wsgi/request_handler.py
+++ b/lib/phusion_passenger/wsgi/request_handler.py
@@ -130,8 +130,6 @@ class RequestHandler:
if 'HTTP_CONTENT_LENGTH' in env:
env['CONTENT_LENGTH'] = env.get('HTTP_CONTENT_LENGTH')
- if 'PATH_INFO' not in env:
- env['PATH_INFO'] = env.get('REQUEST_URI','/').split("?")[0]
import java.io._
val buf = new BufferedReader(new InputStreamReader(System.in))
println("You have no mail")
while (true) {
print("$ ")
buf.readLine match {
case "uname" => println("Punix 1.0 (scala)")
case "halt" => exit(0)
case x => println("Command " + x + " not found.")
@alcides
alcides / gist:267975
Created January 3, 2010 13:40
Script to download mp3 files from a m3u playlist
import os
for line in open("index.m3u"):
os.system("wget %s" % line)
/* `HTML5 Reset
----------------------------------------------------------------------------------------------------*/
a,
abbr,
address,
article,
aside,
audio,
b,
[1, 2, 3, 4, 5].map {|i| i * 2 }.find_all {|i| i > 5 }
# I have started monkey-patching `alias_method :filter, :find_all` in Array.
@alcides
alcides / gist:307182
Created February 18, 2010 00:25
Gerador de Bookmarklet de Login para o WOC (not-safe!)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Login Generator</title>
</head>
<body>
alias git-stats='git log --numstat | awk -f ~/Code/Support/applebin/git-author-commits.awk'
@alcides
alcides / post-receive.sh
Created April 10, 2010 11:37
Post-reveive hook to update the git repository and restart apache on WebFaction
#!/bin/sh
git --git-dir /home/burocratik/webapps/mrg/mrgsite/.git --work-tree /home/burocratik/webapps/mrg/mrgsite reset --hard
PATH=/home/burocratik/webapps/mrg/apache2/bin:$PATH
restart