Skip to content

Instantly share code, notes, and snippets.

View DimitarChristoff's full-sized avatar

Dimitar Christoff DimitarChristoff

View GitHub Profile
// Performance optimization: http://jsperf.com/apply-vs-call-vs-invoke
switch (self ? -1 : args.length) {
case 0: return fn();
case 1: return fn(args[0]);
case 2: return fn(args[0], args[1]);
case 3: return fn(args[0], args[1], args[2]);
case 4: return fn(args[0], args[1], args[2], args[3]);
case 5: return fn(args[0], args[1], args[2], args[3], args[4]);
case 6: return fn(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
var pop = new new Class({
Implements: [Options, Events],
options: {
// onBlock: Function.from(),
// onClose: Function.from(),
// onOpen: Function.from(),
width: 1024,
height: 768,
@DimitarChristoff
DimitarChristoff / Makefile
Created November 20, 2012 12:31
watch example
test := cloudpipes-site/src/test
source := cloudpipes-site/src/main
target := cloudpipes-site/target/cloudpipes-site-1.0-SNAPSHOT/static
targettpl := cloudpipes-site/target/cloudpipes-site-1.0-SNAPSHOT/resources/templates/
install:
npm link .
@command -v casperjs >/dev/null 2>&1 || { echo 'Missing casperjs'; brew install casperjs; }
less:
Request.checkSomething = new Class({
// override Request.JSON and overload results into storage.
Extends: Request.JSON,
Implements: Storage,
options: {
secure: true
},
@DimitarChristoff
DimitarChristoff / autoexec.conf
Created August 8, 2012 18:59
quakelive conf
unbindall
r_smp 1
// Punkbuster
seta cl_punkbuster "1"
seta pb_system "1"
seta pb_security "0"
seta pb_sleep "500"
seta pb_cl_enable "1"
(function(exports) {
var Epitome = {};
typeof define == "function" && define.amd ? define("epitome", [], function() {
return Epitome
}) : typeof module == "object" ? module.exports = Epitome : exports.Epitome = Epitome
})(this), function(exports) {
var Epitome = typeof require == "function" ? require("./epitome") : exports.Epitome,
eq = Epitome.isEqual = function(a, b, stack) {
stack = stack || [];
if (a === b) return a !== 0 || 1 / a == 1 / b;
@DimitarChristoff
DimitarChristoff / log.txt
Created July 10, 2012 10:44
npm test fails due to exit code of buster-test
> npm test
> epitome@0.0.3 test /Users/dchristoff/projects/Epitome
> node_modules/.bin/buster-test
Firefox 13.0.1, OS X 10.7 (Lion): ................................................................................
...
9 test cases, 83 tests, 83 assertions, 0 failures, 0 errors, 0 timeouts
Finished in 0.852s
<?php
/**
* proxy for getting json data via CURL
*/
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
$url = $_REQUEST['url'];
$.if = function(){
var truthy = 1;
for (var i = 0; i < arguments.length; i++){
if (!arguments[i]){
truthy = 0;
break;
}
}