Skip to content

Instantly share code, notes, and snippets.

View tim-smart's full-sized avatar

Tim tim-smart

View GitHub Profile
Connection.prototype.query = function (sql, callback) {
if (!this._queries) this._queries = [];
this._queries.push([sql, callback]);
this.maybeDispatchQuery();
};
var A = function() {};
A.prototype.over = function() {};
var B = function() {
this.where_am_i = 'at work';
A.call(this);
};
var _fn = function() {};
class B extends A
constructor: ->
@where_am_i: 'at work'
sayWhereYouAre: ->
alert 'I am ' + @where_am_i
@tim-smart
tim-smart / CPBox.j
Created February 26, 2010 13:37 — forked from defunkt/CPBox.j
+ (id)boxEnclosingView:(CPView)aView
{
var box = [[self alloc] initWithFrame:CGRectMakeZero()],
enclosingView = [aView superview];
[box setFrameFromContentFrame:[aView frame]];
[enclosingView replaceSubview:aView with:box];
[box setContentView:aView];
var sys = require("sys"),
http = require("http");
var google = http.createClient(80, "www.google.com");
var request = google.request("GET", "/", {"host": "www.google.com"});
request.addListener('response', function (response) {
response.setBodyEncoding("utf8");
var body = '';
// exports defined out here.
exports.foo = "bar"
require(
"sys", "file", "persistence/sqlite3"
)(function (sys, file, sqlite) {
sys.p(File);
// Rest of program here
});
var http = require('http'),
sys = require('sys'),
path = require('path'),
posix = require('posix'),
events = require('events');
var Walker = function() {
this._counter = 0;
};
Walker.prototype = {