Skip to content

Instantly share code, notes, and snippets.

View liamja's full-sized avatar
💾

Liam Anderson liamja

💾
View GitHub Profile
@liamja
liamja / gist:2439909
Created April 21, 2012 22:05
Bash prompt
export PS1="\[\e[35;1m\]$ \[\e[0m\]"
@liamja
liamja / mixpanel.haml
Created April 23, 2012 18:04
Mixpanel HAML
/ start Mixpanel
%script
(function(d,c){var a,b,g,e;a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+'//api.mixpanel.com/site_media/js/api/mixpanel.2.js';b=d.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g="disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config".split(" ");
for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
mixpanel.init("TOKEN");
/ end Mixpanel
@liamja
liamja / bot.rb
Created July 12, 2012 11:22
<100 IRC Bot in Ruby (rubystuff.org)
#!/usr/local/bin/ruby
require "socket"
# Don't allow use of "tainted" data by potentially dangerous operations
$SAFE=1
# The irc class, which talks to the server and holds the main event loop
class IRC
def initialize(server, port, nick, channel)
@liamja
liamja / spoilbrba.js
Created September 3, 2012 12:21
Bookmarklet that reveals spoilers in the Breaking Bad subreddit
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.3.2",function($,L){$('div.link').each(function(i){$(this).removeClass('linkflair-spoiler')});});
@liamja
liamja / mirc.ini
Created April 28, 2013 14:26
Monokai colour scheme for mIRC.
[colors]
n5=Monokai,0,4,4,4,2,3,4,3,6,6,3,1,2,2,5,1,5,4,2,4,0,0,1,0,1,14,5,0,0,1
[palettes]
n5=2238503,15923448,15718758,3072678,7481081,12767183,2070525,26832,1632504,57344,94740,16776960,16515072,16711935,8355711,13816530
@liamja
liamja / liamanderson.asc
Last active December 17, 2015 00:59
My PGP public key.
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.0
mQENBFDxsX4BCACXzaQ774ET0mMYNgzPafyBs/oZYKD8wij5KBv/8FndxB26IkbVhDpB3F+c
bOLZZC+sZCV7QfiOIlX+kXCNpG+BAEPQ+Wo7RSo58BBW35dMeBHEtNOrOjU+6ZRtD/oS6mVQ
qiCZPcjIqLXxlNK+b7FEONkMYdt7dvatSuteQLqcDm1VFqYdZAnH4GKgO4MUQhMdhFU2Wtbs
Fsf7FuS8XoX9xYUzd8hwcmOQKMUPjnNxIf5OvdeAN9kxY+C56wneG6OObpOfuSKGAeZVT2J6
788ctiTcQUe57AslSRpYac7ubnjzjmg3NAJ+2GV9AIJB5I9u1RtUDs7XJWT0jZRL/cuzABEB
AAG0IkxpYW0gQW5kZXJzb24gPGxpYW1qYUBmYXN0bWFpbC5mbT6JATgEEwECACIFAlJXRbwC
Gy8GCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEIiey0AWPLZAlc4IAInRCX5TpfLZzGaN
6qZ8k4BTV5tDPX7HCYk1VB0GG8y6PdISQOx1mmqk+FY3Lnb46aOg0H9Kj5qksPbRARHb8Yty
@liamja
liamja / _flatui_colors.scss
Last active December 17, 2015 22:19
Sass colour variables for designmodo's Flat UI. Dropping the U from the file name was unfortunately intended. http://designmodo.github.io/Flat-UI/
$turquoise: #1abc9c;
$greenSea: #16a085;
$emerland: #2ecc71;
$nephritis: #27ae60;
$peterRiver: #3498db;
$belizeHole: #2980b9;
$amethyst: #9b59b6;
$wisteria: #8e44ad;
$wetAsphalt: #34495e;
$midnightBlue: #2c3e50;
@liamja
liamja / vio_driver.vx
Created September 11, 2013 14:41
Basic driver interface for VX VIO ports
// Programmer: ExclamationDan Sept/1/2013
// Purpose : To create a basic driver interface for VX VIO ports
// Yes, I use Visual Studio.
#pragma once
#include "VX_BIT_DEF.hpp"
#include "VX_BIT_STREAM.hpp"
#include "VX_MODULE_BASE.hpp"
#include "VX_EVENT.hpp"
@liamja
liamja / logKextManager.m
Last active December 24, 2015 21:38 — forked from anonymous/OSReturnAsString.c
Log the return value of the Kext Manager in a human-readable form.
- (void)logKextManager:(OSReturn)osr
{
switch (osr) {
case kOSMetaClassDuplicateClass:
NSLog(@"A duplicate Libkern C++ classname was encountered during kext loading.");
break;
case kOSMetaClassHasInstances:
NSLog(@"A kext cannot be unloaded because there are instances derived from Libkern C++ classes that it defines.");
break;
case kOSMetaClassInstNoSuper:
<?php
?>Ho! Ho! Ho!<?php
?>