Skip to content

Instantly share code, notes, and snippets.

View bertrandom's full-sized avatar

Bertrand Fan bertrandom

View GitHub Profile
\n
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
\n
Script to install yum on a retarded Centos 5.2 box:
rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/rpm-python-4.4.2.3-18.el5.i386.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/python-urlgrabber-3.1.0-5.el5.noarch.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/m2crypto-0.16-6.el5.6.i386.rpm \
Read permissions:
email
read_friendlists
read_insights
read_mailbox
read_requests
read_stream
user_online_presence
friends_online_presence
@bertrandom
bertrandom / InstagramShortUrl.php
Created April 11, 2012 15:14
InstagramShortUrl encoding/decoding service
<?php
namespace Smittn\InstagramBundle\Services;
class InstagramShortUrl {
private $alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
public function __construct() {
@bertrandom
bertrandom / gist:5017613
Created February 23, 2013 00:20
Trip Advisor venue URL -> ID regex
(.*)(d[0-9]+)(.*)
$2
A 20
LEFT 64
UP 55
THROW
typedef enum {
UP,
DOWN,
LEFT,
RIGHT,
X,
Y,
A,
B,
L,
./gifenc.sh "babybump%02d.jpg" "babybump.gif"
convert babybump.gif \( +clone -set delay 300 \) +swap +delete -loop 0 babybump_with_pause.gif