Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am marekventur on github.
  • I am marekventur (https://keybase.io/marekventur) on keybase.
  • I have a public key whose fingerprint is 3F15 3734 2377 6B83 C37D 4F62 DEDC 2CB2 81A4 BE8D

To claim this, I am signing this object:

@marekventur
marekventur / github-pr-slack-threads-bot.js
Last active January 27, 2017 16:14
Hubot Github PR script with Slack thread support
"use strict";
const url = require("url");
const querystring = require("querystring");
module.exports = function (robot) {
robot.router.post("/hubot/gh-pull-requests", function (req, res) {
let query = querystring.parse(url.parse(req.url).query)
let room = query.room || "botvy-test";
function createDeferred() {
let resolve, reject;
let promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
return {resolve, reject, promise};
}
@marekventur
marekventur / profile.js
Created April 27, 2015 22:00
underscore profiling for _.sample and _.shuffle
var _ = require('./underscore');
var N = 1000000;
var i;
var input = _.range(1000);
console.log("input = _.range(1000);");
var start = Date.now();
for (i=0; i<N; i++) {
_.shuffle(input);
}
@marekventur
marekventur / gist:257b122c8517d813b828
Last active August 29, 2015 14:05
TiLDA upload and test on the command line
I have a split teriminal. Both are in the EMF2014 folder.
On the left I compile and upload:
$ screen -S arduino -X quit ; arduino --upload --board emfcamp:sam:tilda_mke_rtos --port /dev/ttyACM0 EMF2014.ino
On the right I connect to the serial port:
$ screen -S arduino /dev/ttyACM0 11520; screen -S arduino -X quit