Skip to content

Instantly share code, notes, and snippets.

View vjeux's full-sized avatar

Christopher Chedeau vjeux

View GitHub Profile
(self.scene.global.H / 2 - y + Math.random() - 0.5) / upscale)
callback()
) # f
], callback # waterfall
), callback # while
) # f
), callback # paralell
) # f
], callback # waterfall
), callback # while
) # f
@vjeux
vjeux / gist:1616150
Created January 15, 2012 15:22
TameJS Output
// Input
var message = "I'm starting to get turned on.";
await {
for (var i = 0; i < 10; i++) {
setTimeout (defer (), 10);
setTimeout (defer (), 100);
}
}
console.log (message);
function f(a) {
var b = yield 'A';
var c = yield 'B';
}
gen = f('a');
var A = gen.next();
var B = gen.send('b');
gen.send('c');
Scrap = require '../src/scrap.js'
match = require 'match'
# Create a new Scrap with the base for all the following requests
wikipedia = new Scrap
path: 'http://en.wikipedia.org/'
# Download the front page as string
wikipedia.get '/', (page) ->
Scrap = require '../src/scrap.js'
match = require 'match'
# Create a new Scrap with the base for all the following requests
wikipedia = new Scrap
path: 'http://en.wikipedia.org/'
# Download the front page as string
wikipedia.get '/', (page) ->
function handlerMaker(obj) {
return {
getOwnPropertyDescriptor: function(name) {
var desc = Object.getOwnPropertyDescriptor(obj, name);
// a trapping proxy's properties must always be configurable
if (desc !== undefined) { desc.configurable = true; }
return desc;
},
getPropertyDescriptor: function(name) {
var desc = Object.getPropertyDescriptor(obj, name); // not in ES5
@vjeux
vjeux / soulver.txt
Created February 16, 2012 18:29
Soulver.js Note
Today's Budget:
$8.50 for the bus * 2 trips
$3.30 for the coffee + $4.40 for the muffin and it wraps over, that's too bad
$22 for lunch + 10% sales tax
This file has been truncated, but you can view the full file.
function Te(){}
function vg(){}
function yg(){}
function zg(){}
function pg(){}
function ei(){}
function Ai(){}
function Ii(){}
function Qi(){}
function Zi(){}
@vjeux
vjeux / gist:2564679
Created May 1, 2012 03:16
Fullscreen Utilities
function canFullScreen() {
return document.body.webkitRequestFullScreen ||
document.body.requestFullScreen ||
document.body.mozRequestFullScreen;
}
function isFullScreen() {
return document.fullScreenElement ||
document.mozFullScreen ||