Skip to content

Instantly share code, notes, and snippets.

View liamzebedee's full-sized avatar
🎯
'drop all repos

Liam Zebedee liamzebedee

🎯
'drop all repos
View GitHub Profile
@liamzebedee
liamzebedee / gocard-api.php
Created December 6, 2011 01:20
GoCard API - Liam Edwards-Playne
<?
/*
An Open-Source Unofficial API for the Translink GoCard System used in Queensland, Australia
Coded by Liam Edwards-Playne (liamzebedee)
Based on the works of Mike from CodeSmash Brisbane 2011
Licensed under GPLv3 to Liam Edwards-Playne
*/
@liamzebedee
liamzebedee / CircleLight.java
Created April 13, 2012 11:24
Slick2D Tile-Based Lighting System
package lessur.engine.lighting.old;
import org.newdawn.slick.Color;
import org.newdawn.slick.geom.Circle;
import org.newdawn.slick.geom.Vector2f;
/**
* A single light in the example. It's capable of determining how much effect
* it will have in any given point on the tile map. Note that all coordinates
* are given in tile coordinates rather than pixel coordinates.
*
@liamzebedee
liamzebedee / Slick2DJBox2DDebugDraw.java
Created July 9, 2012 07:57
JBox2D Debug Draw using Slick2D
package lessur.engine.physics;
import org.jbox2d.callbacks.DebugDraw;
import org.jbox2d.collision.AABB;
import org.jbox2d.common.Color3f;
import org.jbox2d.common.MathUtils;
import org.jbox2d.common.OBBViewportTransform;
import org.jbox2d.common.Transform;
import org.jbox2d.common.Vec2;
import org.jbox2d.pooling.arrays.IntArray;
@liamzebedee
liamzebedee / HOWTO.txt
Created July 12, 2012 05:04
Simple JQuery Content Slider plugin
A content slider is any element with the class 'toggle'. These elements contain 2 main attributes - 'ref', which is a JQuery selector to the element we are toggling, and 'visibility' which is the default visibility of the element referenced by 'ref', which can be either 'hidden' or 'visible'.
The content slider has 2 children which are represent the data to show depending on the visibility. One child is of class 'open' and the other of 'close'. 'open' is shown whenever the 'ref' element is hidden, and 'close' is shown whenever the 'ref' element is shown. Here is an example toggler:
<a class="toggle" ref="#respond" visibility="shown" title="Comment Submission Form Toggle">
<span class="open">Show Comment Form</span>
<span class="close">Hide Comment Form</span>
</a>
@liamzebedee
liamzebedee / example.html
Created September 22, 2012 04:53
Chrome <a> rel attribute bug
<html>
<head>
<style>
a {
text-decoration: none;
}
a[rel^="tag"]:before {
content: "#";
font-size: 1.4em;
}
@liamzebedee
liamzebedee / main.go
Created October 28, 2012 03:38
Go TCPListener.SetDeadline not working
package main
import (
"net"
"time"
)
func main() {
addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:31432")
l, err := net.ListenTCP("tcp", addr)
"""
googleImageLoader ===============================
by liamzebedee <liamzebedee@yahoo.com.au>
Licensed under GPLv3 to Liam Edwards-Playne
=================================================
This plugin provides a simple interface to load
images from Google relevant to the card front.
Requires pip package 'beautifulsoup4'.
"""
RewriteEngine On
RewriteRule ^liam$ /index.php/Liam_Edwards-Playne [NC,L]
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2 [L,QSA,B]
// Now delve down in to the message to get the HTML representation of the selection
nsCOMPtr<nsIDocShell> rootDocShell;
rv = aMsgWindow->GetRootDocShell(getter_AddRefs(rootDocShell));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocShellTreeNode> rootDocShellAsNode(do_QueryInterface(rootDocShell, &rv));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocShellTreeItem> childAsItem;
rv = rootDocShellAsNode->FindChildWithName(NS_LITERAL_STRING("messagepane").get(),
@liamzebedee
liamzebedee / thunderbird-compose.before.patch
Created February 12, 2013 07:48
Before I restarted doing the Thunderbird Tabbed Composition support
# HG changeset patch
# User Liam Zebedee Edwards-Playne <liamzebedee@yahoo.com.au>
# Date 1360655048 -36000
# Branch tabbed_composition #449299
# Node ID 10362e9d3bd927bbe9e33c3d10452bba11d73f1e
# Parent 88ff0c65f2442bc49ce4b3f6cef1405d87f38a53
Current working dir before project restart
diff -r 88ff0c65f244 -r 10362e9d3bd9 mail/base/content/mailCommands.js
--- a/mail/base/content/mailCommands.js Tue Jan 29 14:05:42 2013 +1000