Skip to content

Instantly share code, notes, and snippets.

@Synvox
Synvox / Event.j
Created May 22, 2011 20:23
Cappuccino Instance Variables Problem
/*
* Event.j
* Canvas Creator
*
* Created by Ryan on May 21th, 2011.
* Copyright 2011, Synvox rights reserved.
*/
@import <Foundation/CPObject.j>
@import <AppKit/CPView.j>
@import <Foundation/CPObject.j>
@import "UploadButton.j"
@import "FileLabel.j"
@implementation Uploader : CPObject
{
var cib;
@outlet CPWindow uploaderWindow;
@outlet UploadButton uploadButton;
@outlet CPButton upload;
@implementation FileLabel : CPView
{
CPTextField text;
}
- (id) init
{
self = [super initWithFrame:CGRectMakeZero()];
text = [[CPTextField alloc] initWithFrame:[self bounds]];
[self addSubview:text];
@Synvox
Synvox / object-watch.js
Created January 22, 2012 05:34 — forked from eligrey/object-watch.js
object.watch polyfill
// Cross-browser object.watch and object.unwatch
// object.watch
if (!Object.prototype.watch) {
Object.prototype.watch = function (prop, handler) {
var oldval = this[prop], newval = oldval,
getter = function () {
return newval;
},
setter = function (val) {
@Synvox
Synvox / gist:1941266
Created February 29, 2012 14:42
Robot C Vex
#pragma platform(VEX)
//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(122)
#include "Vex_Competition_Includes.c"
typedef struct {
@Synvox
Synvox / gist:1961832
Created March 2, 2012 22:20
Robot C Vex 2
#pragma platform(VEX)
//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(122)
#include "Vex_Competition_Includes.c"
typedef struct {
@Synvox
Synvox / gist:1962156
Created March 2, 2012 23:03
Robot C Vex 3
#pragma platform(VEX)
//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(122)
#include "Vex_Competition_Includes.c"
typedef struct {
var btn=document.createElement("button");
btn.setAttribute("onclick","winTheGame()");
btn.innerHTML="Get the High Score!";
document.getElementById("canvas_rider").parentNode.insertBefore(btn,document.getElementById("canvas_rider").nextSibling);
function winTheGame(){
C.BU=1; C.Be=C.BU; AZ[0][0]=1; AP.z=5001; C.z=5002; AP.DC();
}
document.onkeyup=function(e){
if (e.keyCode&&e.keyCode==32)
winTheGame();
@Synvox
Synvox / object-watch.js
Created May 1, 2012 04:08 — forked from eligrey/object-watch.js
object.watch polyfill
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
<html>
<head>
<style type="text/css">
</style>
</head>
<body>
<form id="end" action="http://192.168.146.1/pos/firstpos/purch/srch_result.asp" method="post">
<input type="hidden" name="PAR_FNAME" id="fname"/>
<input type="hidden" name="PAR_LNAME" id="lname"/>