Skip to content

Instantly share code, notes, and snippets.

@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: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 / 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 / largest.sh
Created September 25, 2012 08:57
Find largest files in directory
du -a | sort -n -r | head -n 10
@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 / 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 / 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 / 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:4701954
Created February 3, 2013 14:13
Remove a lame gem, from
perl -n -i -e 'print unless /lame/' Gemfile
@timmow
timmow / program
Created February 11, 2013 13:06
Enable symlinking of an executable, into a systemwide bin directory if you want to manage things without rubygems
#!/bin/env ruby
if File.symlink?( __FILE__)
dir = File.dirname(File.readlink(__FILE__))
$:.push( dir + '/lib')
Dir.chdir(dir)
end