Skip to content

Instantly share code, notes, and snippets.

View benjamingr's full-sized avatar
🖊️
Limited availability.

Benjamin Gruenbaum benjamingr

🖊️
Limited availability.
View GitHub Profile
@benjamingr
benjamingr / gist:7437587
Last active December 28, 2015 03:49
Chat room.

So, we figured creating our own chatroom could be fun.

It's something we can all work together on.

We don't plan on moving there but the project itself could be interesting for the whole room to collaborate work on.

What we need to discuss now:

  • What technologies we want to use (Node/Express seems natural for serverside. What about clientside?)
  • What features to we want? Do we just want to start with a clone of the SO chat?

Tasks

For 24.11.2013

##Benji:

Tasks that relate mostly to fronend.

  • HTML/CSS for the page (won't look too good, not a designer)
public class EmailAddress
{
[Match("^")] public string _;
[Match(@"\w+")] public string User;
[Match("@")] public string _1;
[Match("[^@]+")] public string Host;
[Match("$")] public string _2;
}
public static class Matcher
return Promise.resolve().then(function rest() {
return Rest.webService({apiUrl: "/v4_6_release/apis/3.0/system/members", method: "GET" }).then(result =>
(Array.isArray(result) && result.length === 0) ? "Done" : rest();
});
});
function liquidate(obj, F = Promise.getNewLibraryCopy()) {
const promised = F.promisifyAll({__proto__: Object.create(obj)});
Object.assign(F.prototype, whenReadyAll.call(obj, promised)); // add the API
return promised;
function whenReadyAll(obj, target = {}) {
for(const prop in obj) target[prop] = (...args) => this.then(() => obj[prop](...args));
return target;
}
}
/*
* Mustache like logic less templating with reverse data binding
*/
//HACK, do not use, EVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVER
//EVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVER
//EVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVEREVER
// in production code
//templates a given view based on the given viewmodel, for more detail on how this works please check the unit tests
window.Mustache = {};
diff --git a/benchmark/doxbee-sequential/callbacks-caolan-async-waterfall.js b/benchmark/doxbee-sequential/callbacks-caolan-async-waterfall.js
deleted file mode 100644
index 439f9bba..00000000
--- a/benchmark/doxbee-sequential/callbacks-caolan-async-waterfall.js
+++ /dev/null
@@ -1,71 +0,0 @@
-require('../lib/fakes');
-var async = require('async');
-
-module.exports = function upload(stream, idOrPath, tag, done) {
Eggs.Map = function() {}
,
Eggs.Map.init = function() {
function t() {
var t = ($(window).scrollTop() + $(window).height()) / $(document).height() * .6;
s.css("background-size", t * a + "px auto"),
s.css("background-position", 800 - o.x * t + "px " + (40 - o.y * t) + "px")
}
function e() {
var t = i()
@benjamingr
benjamingr / peer5-load-conditionally.js
Last active August 31, 2017 08:13
This code snippet lets you load Peer5 without
// load Peer5 with a script timeout
var initiated;
function initClappr() {
if (initiated) return;
initiated = true;
// var player = new Clappr.Player();
// rest of clappr initialization
}

Post Mortem Debugging in NodeJS in the Light of Promises

Context:

we're discussing how we can safely abort on unhandled rejections and obtain meaningful debugging information. Related reading: https://gist.github.com/misterdjules/2969aa1b5e6440a7e401#file-post-mortem-debugging-with-promises-md.

In particular, we're discussing https://gist.github.com/misterdjules/2969aa1b5e6440a7e401#removing-implicit-trycatch-blocks-from-v8s-promises-implementation

Othe recommended reading: On unhandledRejection https://gist.github.com/benjamingr/0237932cee84712951a2