This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting up an AS3/TextMate project, before I forget: | |
System | |
====== | |
1. Install SDK in /Developer/SDKs/flex_sdk_x | |
2. Add SDK to $PATH (optional) | |
3. Install ActionScript 3 Bundle (if not in shared-env) | |
4. Set TextMate vars (Preferences -> Advanced -> Shell Variables) | |
* TM_FLEX_USE_FCSH => true | |
* TM_FLEX_PATH => /Developer/SDKs/flex_sdk_x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
require 'thread' | |
module SC | |
PORT = 0x55DE | |
def self.test | |
queue = Queue.new | |
sender = MessageSender.new(queue) | |
sender.start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'></script> | |
<script type='text/javascript'> | |
var states = {}; | |
// w - 87 | |
// a - 65 | |
// s - 83 | |
// d - 68 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This is how I would do this in Javascript | |
p RUBY_VERSION # 1.8.7 | |
puts "With factory method:" | |
procs_1 = [] | |
def make_proc(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Handler { | |
public void handle(InputEvent ie) { | |
ie.dispatch(this); | |
} | |
public void handleInput(InputEvent ie) { | |
System.out.println("ERROR - NO HANDLER DEFINED"); | |
} | |
public void handleInput(MouseEvent me) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int squares[] = { | |
0, 36, 0, 10, 0, 0, 0, 0, 22, 0, | |
0, 0, 0, 0, 0, 0, -10, 0, 0, 0, | |
21, 0, 0, 0, 0, 0, 0, 56, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (id)initWithFrame:(CGRect)frame { | |
if ((self = [super initWithFrame:frame])) { | |
if (![self _bindLayer]) { | |
[self release]; | |
self = nil; | |
} | |
} | |
return self; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = arm-none-eabi-gcc | |
LD = arm-none-eabi-ld -v | |
AR = arm-none-eabi-ar | |
AS = arm-none-eabi-as | |
CP = arm-none-eabi-objcopy | |
OD = arm-none-eabi-objdump | |
CFLAGS = -I./ -I./stdlib/inc -DSTM32F10X_MD -fno-common -O0 -g -mcpu=cortex-m3 -mthumb | |
AFLAGS = -ahls -mapcs-32 | |
LFLAGS = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum ShotType { | |
PISTOL (2, new Vec3f(0, 0, -35), new Vec3f(0, -1, 0), 0.99f), | |
ARTILLERY (200, new Vec3f(0, 30, -40), new Vec3f(0, -20, 0), 0.99f), | |
FIREBALL (1, new Vec3f(0, 0, -10), new Vec3f(0, 6, 0), 0.9f), | |
LASER (0.1f, new Vec3f(0, 0, -100), new Vec3f(0, 0, 0), 0.99f); | |
private final float mass; | |
private final Vec3f velocity; | |
private final Vec3f acceleration; | |
private final float damping; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// trying to do this: | |
var fn = new Function("foo", "bar", "baz", "return foo + bar + baz;"); | |
// with arbitrary number of args: | |
var args = ["foo", "bar", "baz"]; | |
var src = "return foo + bar + baz;" | |
// with a non-ctor fn i'd do: | |
var allArgs = args.slice(0); | |
allArgs.push(src); |