Skip to content

Instantly share code, notes, and snippets.

View mnem's full-sized avatar

Dave Clayton-Wagner mnem

View GitHub Profile
public function newMrNoisy() :void
{
returnMrNoisy(new MrNoisy()).thing += 50;
}
// ABC Output for newMrNoisy
// function :CompoundOperatorsAndNew:::newMrNoisy()::void
// maxStack:3 localCount:1 initScopeDepth:9 maxScopeDepth:10
// getlocal0
// pushscope
// getlocal0
public function speedTestA() :void
{
var a :int = 1;
var b :int = 2;
b = a + a + a;
}
public function speedTestB() :void
{
// This is just one of the reasons why
// treating null as a boolean false
// is Bad and Wrong
var iAmAStringInstance :String = "";
var iAmANullString :String = null;
if(iAmAStringInstance)
{
trace("iAmAStringInstance: That there is an instance!");
// meh...
var iAmAStringInstance :String = "";
var iAmANullString :String = null;
if(iAmAStringInstance)
{
trace("iAmAStringInstance is neither null nor empty");
}
else
package shadowed
{
import flash.system.ApplicationDomain;
/**
* @author David Wagner
*/
public class ShadowedUnescape
{
private static var _unescape :Function;
package shadowed
{
import flash.system.ApplicationDomain;
public class TraceryFoo
{
private static var _trace :Function;
// Static initialiser block.
{
@mnem
mnem / pretty_git_bash.sh
Created September 20, 2010 22:51
Prettifies bash terminals with git
# Setup the prompt so that it shows the current branch when in a git directory.
source /usr/local/etc/bash_completion.d/git-completion.bash
source /usr/local/etc/bash_completion.d/git-prompt.sh
function setup_prompts_for_git
{
local BLUE="\[\e[0;34m\]"
local RED="\[\e[0;31m\]"
local YELLOW="\[\e[0;33m\]"
local PURPLE="\[\e[0;35m\]"
local CLR_RESET="\[\e[0m\]"
@mnem
mnem / virgin-wifi-suckiness.txt
Created March 12, 2011 10:49
5 minute ping sample while using the Virgin trains WiFi. It's unusably bad.
Sat 12 Mar 2011 10:40:11 GMT
PING google.com (74.125.230.144): 56 data bytes
64 bytes from 74.125.230.144: icmp_seq=0 ttl=52 time=112.200 ms
64 bytes from 74.125.230.144: icmp_seq=1 ttl=52 time=157.935 ms
64 bytes from 74.125.230.144: icmp_seq=2 ttl=52 time=169.076 ms
64 bytes from 74.125.230.144: icmp_seq=3 ttl=52 time=102.831 ms
64 bytes from 74.125.230.144: icmp_seq=4 ttl=52 time=109.030 ms
64 bytes from 74.125.230.144: icmp_seq=5 ttl=52 time=319.923 ms
64 bytes from 74.125.230.144: icmp_seq=6 ttl=52 time=398.569 ms
64 bytes from 74.125.230.144: icmp_seq=7 ttl=52 time=516.607 ms
@mnem
mnem / gist:935547
Created April 21, 2011 21:37
Awesome spam
Greetings!
Recently, the problem of account invasion is getting worse and worse
which cause enormous player’s equipments and virtual currency stolen.
This severely damages the benefits of mass players, also causes our
company lose a lot of customers.
Our company has to adopt some measures to safeguard our common benefits
in order to strengthen the safety of mass players'accounts, and firmly
resist the account to be stolen again.Through our company's research and
Ⓓⓐⓜⓝ ⓔⓝⓒⓞⓓⓘⓝⓖ