Skip to content

Instantly share code, notes, and snippets.

View mnem's full-sized avatar

Dave Clayton-Wagner mnem

View GitHub Profile
// 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
Ⓓⓐⓜⓝ ⓔⓝⓒⓞⓓⓘⓝⓖ
@mnem
mnem / .bash_profile
Created July 26, 2011 19:10
Backup of my basic bash profile for OS X so I can lazy curl it to new installs.
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
# 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
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\]"
@mnem
mnem / .bash_profile
Created July 27, 2011 13:38
Setting FLEX_HOME in Lion for FDT Ant
export FLEX_HOME=/Users/mnem/Developer/Frameworks/flex/4.5.1.21328
launchctl setenv FLEX_HOME $FLEX_HOME
@mnem
mnem / Shuffle.as
Created August 11, 2011 15:30
A non-insane Array shuffler for AS3
package utils
{
/**
* Simple class to shuffle items in arrays using a modern Fisher–Yates shuffle as described
* by Richard Durstenfeld in ACM volume 7, issue 7: "Algorithm 235: Random permutation".
*
* Wikipedia: http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
*
*
* Author: David Wagner