Skip to content

Instantly share code, notes, and snippets.

@ptarjan
ptarjan / gpg-encrypt.sh
Created May 25, 2009 00:54
gpg-encrypt . A simple script for keeping a file gpg encrypted.
#!/bin/sh
filename="passwords.gpg"
if [ $EDITOR ]
then
editor=$EDITOR
elif [ -f /usr/bin/editor ]
then
editor=/usr/bin/editor
else
editor=vi
Deprecated: Assigning the return value of new by reference is deprecated in /var/www/paul.slowgeek.com/openidavatar/site/sessions/openid/common.php on line 71
Deprecated: Assigning the return value of new by reference is deprecated in /var/www/paul.slowgeek.com/openidavatar/site/sessions/openid/Auth/OpenID/Consumer.php on line 271
Deprecated: Assigning the return value of new by reference is deprecated in /var/www/paul.slowgeek.com/openidavatar/site/sessions/openid/Auth/OpenID/Consumer.php on line 273
Deprecated: Assigning the return value of new by reference is deprecated in /var/www/paul.slowgeek.com/openidavatar/site/sessions/openid/Auth/Yadis/XRDS.php on line 355
Warning: Parameter 2 to Auth_OpenID_GenericConsumer::_completeInvalid() expected to be a reference, value given in /var/www/paul.slowgeek.com/openidavatar/site/sessions/openid/Auth/OpenID/Consumer.php on line 669
Unknown Error. Try again.
@ptarjan
ptarjan / rockband.py
Created November 21, 2009 21:01
Algorithm for swtiching instruments in rockband. http://blog.paulisageek.com/2009/10/rock-band-group-algorithm.html
import random
import sys
instruments = ["Drums", "Vocals", "Guitar", "Bass"]
people = sys.argv[1:]
if len(people) == 0:
print "python rockband.py Name1 Name2 ..."
sys.exit()
if len(people) < len(instruments):
# This script will search google voice to see if there are any numbers
# available that spell a 10 letter word
#
# It can easily be customized for 9 letters, or to use your own dictionary, etc.
#
# Author: Paul Tarjan <http://paulisageek.com>
#
# Make sure you put your own cookie here. Search the web if you don't know how to find it.
cookie = "DQAAA<rest of cookie>"
git log --since="12 months ago" --author=$USER | grep Summary: | wc -l
git log --since="12 months ago" | grep 'Reviewed By: '$USER | wc -l
git log --since="12 months ago" | grep 'CC: ' | grep $USER | wc -l
git log --since="12 months ago" --author=$USER --numstat | grep '^[0-9]' | awk '{sum+=$1} END {print sum}'
git log --since="12 months ago" --author=$USER --numstat | grep '^[0-9]' | awk '{sum+=$2} END {print sum}'
@ptarjan
ptarjan / brew doctor
Created July 25, 2011 03:57
brew update -v
$ brew doctor
Error: undefined method `<' for nil:NilClass
Please report this bug: https://github.com/mxcl/homebrew/wiki/Checklist-before-filing-a-new-issue
/usr/local/Library/Homebrew/cmd/doctor.rb:197:in `check_gcc_versions'
/usr/local/Library/Homebrew/cmd/doctor.rb:735:in `doctor'
/usr/local/bin/brew:82:in `send'
/usr/local/bin/brew:82
@ptarjan
ptarjan / gist:1196701
Created September 6, 2011 05:55
Download all your photos from Flickr
#!/usr/bin/env python
#
# FlickrTouchr - a simple python script to grab all your photos from flickr,
# dump into a directory - organised into folders by set -
# along with any favourites you have saved.
#
# You can then sync the photos to an iPod touch.
#
# Version: 1.2
This file has been truncated, but you can view the full file.
commit 8dad12c965a4abfb05124f671f077106972152f9
Author: Paul Tarjan <ptarjan@fb.com>
cleanup test output
Summary:
I started cleaning up the perl script and then realized that it wasn't buying us much at all. So I changed the ##test/run## script to just do the executing of the ##hhvm## directly and printing the output.
While I was in there, I also made the ##verify_to_json.php## redundant by allowing different output formats, one of which fbmake can consume.
@ptarjan
ptarjan / gist:7649248
Created November 25, 2013 21:31
HHVM Project Theme for Open Academy - 2013/14

HHVM

HHVM is a an open-source virtual machine designed for executing programs written in PHP. HHVM uses a just-in-time compilation approach to achieve superior performance while maintaining the flexibility and ease of use that PHP developers are accustomed to (dynamic features like eval(), rapid run-edit-debug cycle, etc).

HHVM is used by Facebook to serve billions of web requests per day. To date, HHVM has realized over a 9x increase in web request throughput and over a 5x reduction in memory consumption for Facebook compared with the Zend PHP 5.2 engine + APC.

You can learn more going through our wiki.

Objectives

diff --git a/hphp/runtime/server/fastcgi/fastcgi-server.cpp b/hphp/runtime/server/fastcgi/fastcgi-server.cpp
index 93bee22..7bd2de4 100644
--- a/hphp/runtime/server/fastcgi/fastcgi-server.cpp
+++ b/hphp/runtime/server/fastcgi/fastcgi-server.cpp
@@ -118,12 +118,10 @@ void FastCGIConnection::readDataAvailable(size_t len) noexcept {
void FastCGIConnection::readEOF() noexcept {
shutdownTransport();
- delete this;
}