Skip to content

Instantly share code, notes, and snippets.

@timmow
timmow / inheritance.pp
Created November 30, 2012 12:11
inheritance
class test ($test=bob) inherits parent {
notify{$test:}
}
class child ($test=bob) inherits parent {
notify{$test:}
}
class parent($test=bob) {
# do something with $test as passed through to the paramaterized class, rather than having to do
@timmow
timmow / gist:4086836
Created November 16, 2012 12:14
Get a list of dates on a google calendar
# download your private calendar url as xml
wget http://url/to/calendar
grep -o 'When:.*12' basic | uniq | perl -ple 's/When://' | ruby -e 'require "date"; puts STDIN.readlines.sort_by!{|x| Date.parse x}'
@timmow
timmow / gist:3945950
Created October 24, 2012 13:05
Useful tcpdumps
# All udp on port 2000
tcpdump -i eth0 udp port 2000
# port 8080 traffic, ascii view
tcpdump -vv -x -X -s 1500 -i eth1 'port 8080'
@timmow
timmow / hack.sh
Created October 9, 2012 11:17 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@timmow
timmow / largest.sh
Created September 25, 2012 08:57
Find largest files in directory
du -a | sort -n -r | head -n 10
@timmow
timmow / after
Created June 30, 2012 13:35
Class file before and after - stored in lib/Tim/Test.class.php
<?php
namespace Tim;
class Test
{
}
@timmow
timmow / gist:2889853
Created June 7, 2012 16:23
Add all empty directories within project to git
find . -depth -empty -type d -exec touch \{\}/.gitignore \;
git add .
git commit -m 'Sort out all the empty directories, as git does not track them by default'
git push origin master
@timmow
timmow / gist:1450982
Created December 9, 2011 10:11
Pluck Forums minimal
<!DOCTYPE html>
<html xmlns:pas="http://phpinfo.tmower.connect-dev-web-01.bfb1.sites.ipcdigital.co.uk/pluckTest.html" xml:lang="en" lang="en">
<head>
<title>Client Flow Example</title>
<script type="text/javascript" src="http://goodtoknow.pluck.ipcdigital.co.uk/ver1.0/Content/ua/scripts/pluckApps.js"></script>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '152695124822835', // App ID
@timmow
timmow / gist:1439003
Created December 6, 2011 17:14
Private messaging widget
<!DOCTYPE html>
<html xmlns:pas="http://phpinfo.tmower.connect-dev-web-01.bfb1.sites.ipcdigital.co.uk/pluckTest.html" xml:lang="en" lang="en">
<head>
<title>Client Flow Example</title>
<script type="text/javascript" src="http://goodtoknow.pluck.ipcdigital.co.uk/ver1.0/Content/ua/scripts/pluckApps.js"></script>
<script>
window.fbAsyncInit = function() {
FB.init({
@timmow
timmow / setup-statsd.sh
Created November 13, 2011 23:43 — forked from jasonroelofs/setup-statsd.sh
Turn an Ubuntu 11.10 EC2 into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
sudo apt-get install nodejs
# install the Node package manager for later use
curl http://npmjs.org/install.sh | sudo sh
sudo npm install express
# clone the statsd project
git clone https://github.com/etsy/statsd.git
# download everything for graphite