Skip to content

Instantly share code, notes, and snippets.

View indexzero's full-sized avatar
🗽
✊ Fist in the air in the land of hypocrisy

Charlie Robbins indexzero

🗽
✊ Fist in the air in the land of hypocrisy
View GitHub Profile
// from https://gist.github.com/613924
Proxy._noopHandler = function noopHandler(obj) {
return {
getOwnPropertyDescriptor: function(name) {
var desc = Object.getOwnPropertyDescriptor(obj, name);
// a trapping proxy's properties must always be configurable
desc.configurable = true;
return desc;
},
getPropertyDescriptor: function(name) {
@cowboy
cowboy / ba-curry.js
Created November 30, 2010 01:59
JavaScript Curry
/*!
* JavaScript Curry - v0.1pre - 11/29/2010
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
function curry(/* n,*/ fn /*, args...*/) {
@isaacs
isaacs / http-example-client.js
Created December 1, 2010 08:35
a simple example of a nodejs http client making a POST request
var http = require("http")
, util = require("sys") // 0.3.x: require("util")
, fs = require("fs")
, client = http.createClient(80, "example.com")
, request = client.request("POST", "/", {"host":"example.com"})
// send body chunks
request.write("hello, world")
// pump a file through
@ryanb
ryanb / github_tree_slider.js
Created December 6, 2010 17:23
This is how GitHub's new AJAX file browser works.
GitHub.TreeSlider = function () {
if (window.history && window.history.pushState) {
function a() {
if (e.sliding) {
e.sliding = false;
$(".frame-right").hide();
$(".frame-loading:visible").removeClass("frame-loading")
}
}
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
/*
my OOP in js is more and more closer to java/c++/c# :P
1) now it allows create instance w/o <new> keyword (all native classes supports instance creating w/o <new> except <Date>)
2) removes <prototype> extra word when you access to static fields and methods(<Class.prototype = Class> magic)
3) automatic delegates/<Function#bind>. My delegates always is begined from '_on' prefix
4) has own implementation of <instanceof> operator - <Object#_hasBaseClass>
5) base constructors call via special <Object#_callBaseConstructor>
6) derivation do not uses prototype machanism(because slow resolving). I use just copy _methods/InternalTypes/CONSTS. Yes its based on codestyle. But you can use <typeof> or <Object#toString> instead.
*/
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
@Marak
Marak / gist:772298
Created January 10, 2011 03:12 — forked from gerhard/gist:372205
#!/usr/bin/env ruby
# Configures the git author to a list of developers when pair programming
#
# Usage: pair cr pf (Sets the author to 'Charlie Robbins, and Paolo Fragomeni')
# pair (Unsets the author so the git global config takes effect)
#
# Author: Bryan Helmkamp (http://brynary.com)
#######################################################################
/*
Shows that strongly typed vars is possible in js! And do not worry about speed. :) Robust type system is more important than yet another benchmark :P. And i'll plan to make deploy system which checks all types and removes all 'ugly' `with`. This code definitely should be complexer, but i keep it simple.
P.S. `with` rulezzz
P.P.S. As you see its too easy to make field of class strongly typed too.
*/
(function($G){
if(Object.defineProperty && !{}.__defineGetter__)
{
Object.prototype.__defineGetter__ = function(name, _fn)
.antiantialias {
-webkit-transition: all 100000.0s linear;
-moz-transition: all 100000.0s linear;
-o-transition: all 100000.0s linear;
-transition: all 100000.0s linear;
-webkit-transform: translate(0px, 1px);
-moz-transform: translate(0px, 1px);
-o-transform: translate(0px, 1px);
transform: translate(0px, 1px);
}
@loginx
loginx / jquery_isotope_reset.js
Created February 15, 2011 17:35
Extends Isotope, providing a reset() method to empty the grid and reLayout.
// Adds a .isotope( 'flush' ) method to your Isotope widget.
// This method will remove all items from the widget and from the DOM,
// then trigger a reLayout.
$.Isotope.prototype.flush = function() {
this.$allAtoms = $();
this.$filteredAtoms = $();
this.element.children().remove();
this.reLayout();
};