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
export PS1="\[\033[01;31m\]\$(status=\$?; [[ \$status -ne 0 ]] && echo \"[\$status] \")\[\033[01;32m\]\u@\h \[\033[01;34m\]\w\n\$ \[\033[00m\]" | |
alias reload="curl -s https://gist.githubusercontent.com/progrium/6a24ae8d7ab93bc65579/raw/gistfile1.txt > ~/.profile.me; source ~/.profile" | |
alias g="git" | |
alias gpr="git pull --rebase origin" | |
alias gprr="git pull --rebase" | |
alias gpu="git push origin" | |
alias gpuu="git push" | |
alias gs="git status" |
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
=begin | |
Message Pack vs similar utilities | |
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.0.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02 | |
Packing | |
user system total real | |
pack: bert 18.320000 0.770000 19.090000 ( 19.101583) | |
pack: bson_ext 0.850000 0.030000 0.880000 ( 0.878398) | |
pack: json_ext 2.540000 0.040000 2.580000 ( 2.582495) |
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
import gevent | |
from gevent.server import StreamServer | |
from gevent.pool import Group | |
from gevent_zeromq import zmq | |
context = zmq.Context() | |
class CodependentGroup(Group): | |
""" | |
A greenlet group that will kill all greenlets if a single one dies. |
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
# Please see <https://github.com/inportb/playground/tree/master/Pinako/csp_gevent> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<DieCutLabel Version="8.0" Units="twips"> | |
<PaperOrientation>Landscape</PaperOrientation> | |
<Id>Label</Id> | |
<PaperName>30258 Diskette</PaperName> | |
<DrawCommands> | |
<RoundRectangle X="0" Y="0" Width="3060" Height="3960" Rx="270" Ry="270"/> | |
</DrawCommands> | |
<ObjectInfo> | |
<ImageObject> |
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
var badge = Raphael(200, 0, 225, 187); | |
// Header | |
var attrs = {'fill': '#f90', 'stroke': 'none', 'font-size': 11, 'font-family': 'helvetica'}; | |
badge.rect(5, 3, 225, 14).attr(attrs); | |
badge.circle(212, 8, 16).attr(attrs); | |
var textAttrs = {'fill': '#fff', 'font-size': 11, 'font-family': 'helvetica', 'text-anchor': 'end'}; | |
var text = badge.text(198, 9, "SuperHappyDevHouse"); | |
text.attr(textAttrs); | |
var num = badge.text(211, 9, "48"); |
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
# Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details. | |
"""UDP/SSL server""" | |
import sys | |
import errno | |
import traceback | |
from gevent import socket | |
from gevent import core | |
from gevent.baseserver import BaseServer | |
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
#!/usr/bin/env bash | |
# wait_port <port> <seconds> | |
check_port () | |
{ | |
netstat -tpln 2> /dev/null | sed -E '/^[^t]/ d; s/^([^ ]+ +){3}//; s/ .*$//; s/^.*://;' | grep --color "^$1$" > /dev/null | |
} | |
wait_port () |
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 | |
# Usage: | |
# $ ./heroku-deploy.sh <app name> <git repo url> <heroku api key> | |
APP="$1" | |
REPO="$2" | |
APIKEY="$3" | |
echo "-----> Creating application $APP" | |
curl -u ":$APIKEY" -d "app[name]=$APP" -X POST https://api.heroku.com/apps -s > /dev/null |
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
import os | |
import sys | |
import fcntl | |
import gevent | |
from gevent.socket import wait_read | |
def print_every(s, repeat=1): | |
print s | |
if repeat: |
OlderNewer