Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
hughfdjackson / gist:1495286
Created December 19, 2011 03:45 — forked from anonymous/gist:1495280
galamar - pastebin.com/MnRqKrry
<!DOCTYPE HTML>
<html>
<head>
<title>Pizza To Go</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h1>Pizza To Go</h1>
<form id="f0">
function MixTracker(token) {
if (token == null) throw "You forgot to enter a MixPanel token!";
this.token = token;
this.mpq = [];
this.mpq.push(["init", this.token]);
(function () {
var b, a, e, d, c;
b = document.createElement("script");
b.type = "text/javascript";
b.async = true;
GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
shell returned 1
:!ghc -o hello --make main.hs
[1 of 1] Compiling Main ( main.hs, main.o )
main.hs:31:4: parse error on input `x'
shell returned 1
@hughfdjackson
hughfdjackson / gist:1540723
Created December 30, 2011 17:37 — forked from anonymous/gist:1540718
codazoda - pastebin.com/iSQYG4DY
// Create the Iso class
function Iso() {
// Public Properties
this.canvas = '';
this.context = '';
}
Iso.prototype.init = function(div) {
@hughfdjackson
hughfdjackson / gist:1540724
Created December 30, 2011 17:37 — forked from anonymous/gist:1540718
codazoda - pastebin.com/iSQYG4DY
// Create the Iso class
function Iso() {
// Public Properties
this.canvas = undefined;
this.context = undefined;
}
Iso.prototype = {
function MyClass()
{
var self = this
// warning message if mouse moves more than halfway across the screen
this.check_mouse = function() {
if (mouse_x >= SCREEN_WIDTH / 2)
{
alert("What are you doing?!");
@hughfdjackson
hughfdjackson / gist:1565311
Created January 5, 2012 13:42
Pattern matching
function int_actions(num){
return num == 1 ? "1"
: num == 2 ? "2"
: num == 3 ? "3"
: /*else*/ "NOT MATCHED"
}
console.log(int_actions(1))
console.log(int_actions(2))
void function(){
var images = {} // where we're keeping our images
function image_callback(i){
// copy any loaded images over to the images object
for ( var prop in i ) {
images[prop] = i[prop]
}
@hughfdjackson
hughfdjackson / gist:1618815
Created January 16, 2012 03:01 — forked from anonymous/gist:1618812
grom358 - MtG
function Card(cardName, cardType) {
this.cardName = cardName;
this.cardType = cardType;
this.manaCost = new Mana();
this.tapped = false;
this.summonSickness = false;
this.power = 0;
this.toughness = 0;
this.owner = null;
this.player = null;
var purr = require('../utils/purr')
var scene = purr.create('scene')
scene.init = function(images){
var canvas = scene.director.canvas
// --- Scene Data --- //
var data = {