Skip to content

Instantly share code, notes, and snippets.

View tomislacker's full-sized avatar

Ben Tomasik tomislacker

View GitHub Profile
@brendano
brendano / autolog.py
Created October 10, 2008 23:00
python decorators to log all method calls, show call graphs in realtime too
# Written by Brendan O'Connor, [email protected], www.anyall.org
# * Originally written Aug. 2005
# * Posted to gist.github.com/16173 on Oct. 2008
# Copyright (c) 2003-2006 Open Source Applications Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
<?php
// GoogleVoice(EMAIL, PASSWORD)
$gv = new GoogleVoice('[email protected]', 'password');
// Sends an SMS. send_sms(NUMBER, MESSAGE)
echo $gv->send_sms('+15555555555', 'Example');
// Gets all the sms
// get_sms() - returns all the sms
// get_sms(true) - returns all the unread sms
echo $gv->get_sms();
@danielfaust
danielfaust / samsung_remote.py
Created May 30, 2011 04:12
Samsung TV Remote Control Python Script
import time
import socket
import base64
src = '192.168.1.2' # ip of remote
mac = '00-AB-11-11-11-11' # mac of remote
remote = 'python remote' # remote name
dst = '192.168.1.3' # ip of tv
app = 'python' # iphone..iapp.samsung
@nijikokun
nijikokun / yaml.syntax.js
Created August 8, 2011 02:14
SyntaxHighlighter for YAML
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.0.320 (July 26 2009)
*
<?php
/**
* Executes a mysql 5.5 safe truncate against all tables in a dataset.
*
* @package DbUnit
* @author Mike Lively <[email protected]>
* @copyright 2011 Mike Lively <[email protected]>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
@jtai
jtai / parse-tcpdump-udp-port-53.php
Last active January 16, 2019 16:06
Quick and dirty script to parse output of /usr/sbin/tcpdump -vvv -s 0 -l port 53
<?php
// quick and dirty argument parsing
foreach ($argv as $arg) {
if ($arg == '-f') {
define('FOLLOW', true);
}
if ($arg == '-h') {
define('HISTOGRAM', true);
}
@gregburek
gregburek / rateLimitDecorator.py
Created December 7, 2011 01:51
Rate limiting function calls with Python Decorators
import time
def RateLimited(maxPerSecond):
minInterval = 1.0 / float(maxPerSecond)
def decorate(func):
lastTimeCalled = [0.0]
def rateLimitedFunction(*args,**kargs):
elapsed = time.clock() - lastTimeCalled[0]
leftToWait = minInterval - elapsed
if leftToWait>0:
@andris9
andris9 / git-cache-meta.sh
Created March 5, 2012 13:15
git-cache-meta
#!/bin/sh -e
#git-cache-meta -- simple file meta data caching and applying.
#Simpler than etckeeper, metastore, setgitperms, etc.
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
#modified by n1k
# - save all files metadata not only from other users
# - save numeric uid and gid
# 2012-03-05 - added filetime, andris9
@mariusrugan
mariusrugan / speedtest.sh
Created May 15, 2012 09:27
CURL download benchmark
#!/ffp/bin/bash
SOURCES=(
"http://ns0.multikabel.net/100mb.nul"
"http://servermars.nl/100mb.bin"
"http://speedtest.tweak.nl/100mb.bin"
"http://cachefly.cachefly.net/100mb.test"
"http://mirror.leaseweb.com/speedtest/100mb.bin"
"http://mirror.de.leaseweb.net/speedtest/100mb.bin"
"http://178.238.129.83/bigtest.tgz"
@trey
trey / happy_git_on_osx.md
Last active September 19, 2024 16:23
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "[email protected]"