Skip to content

Instantly share code, notes, and snippets.

View hybrist's full-sized avatar
Modules. Modules everywhere.

Jan Olaf Martin hybrist

Modules. Modules everywhere.
View GitHub Profile
@hybrist
hybrist / shrinkwrap.md
Last active August 29, 2015 14:05
State of `npm shrinkwrap`
@hybrist
hybrist / generators.md
Last active February 7, 2026 03:31
Generators Are Like Arrays

In all the discussions about ES6 one thing is bugging me. I'm picking one random comment here from this io.js issue but it's something that comes up over and over again:

There's sentiment from one group that Node should have full support for Promises. While at the same time another group wants generator syntax support (e.g. var f = yield fs.stat(...)).

People keep putting generators, callbacks, co, thunks, control flow libraries, and promises into one bucket. If you read that list and you think "well, they are all kind of doing the same thing", then this is to you.

@hybrist
hybrist / fun.js
Created December 10, 2014 05:17
What could go wrong..?
import * as assert from 'assert';
import { MY_FLAG } from './trust';
assert.ok(MY_FLAG === 1);
setTimeout(function() {
try {
assert.ok(MY_FLAG === 1);
} catch (err) {
console.log('Just ES6 things.');
}

Keybase proof

I hereby claim:

  • I am jkrems on github.
  • I am jkrems (https://keybase.io/jkrems) on keybase.
  • I have a public key whose fingerprint is D289 A52C 5FD8 2339 0E33 1D9B 24E9 38F4 69EE 83D5

To claim this, I am signing this object:

INFO [2015-03-16 22:25:39,674] com.groupon.paywithgroupon.steno.StenoServletFilter: {"time":"2015-03-16T22:25:39.674Z","name":"http.in.start","level":"info","data":{"context":{"transactionId":"705d975e-0ab4-4299-8950-54323a57e5b1"}}}
INFO [2015-03-16 22:25:39,789] com.groupon.paywithgroupon.steno.StenoJaxRsFilter: {"time":"2015-03-16T22:25:39.778Z","name":"http.out.start","level":"info","data":{"method":"GET","url":{"protocol":"http","host":"orders-read-proxy1-staging.snc1","port":-1,"path":"/tps/v1/users/d6b37100-c9c2-11e4-a073-52540a145061/billing_records","query":"use_consumer_id=true"},"groupId":"dd617031-258e-4da0-8229-efdd73addd2d","service":"orders","resource":"billingRecords","action":"getForConsumer","context":{"transactionId":"705d975e-0ab4-4299-8950-54323a57e5b1"}}}
INFO [2015-03-16 22:25:40,275] com.groupon.paywithgroupon.steno.StenoJaxRsFilter: {"time":"2015-03-16T22:25:40.275Z","name":"http.out","level":"info","data":{"method":"GET","url":{"protocol":"http","host":"orders-read-proxy1-staging.
@hybrist
hybrist / edge-case.diff
Last active August 29, 2015 14:23
Edge case for node-inspector NetworkAgent
diff --git a/test/NetworkAgent.js b/test/NetworkAgent.js
index f63309b..0d21572 100644
--- a/test/NetworkAgent.js
+++ b/test/NetworkAgent.js
@@ -177,6 +177,15 @@ describe('NetworkAgent', function() {
commandlet.stdin.write('send GET request\n');
});
+
+ xit('should report queued requests', function(done) {
@hybrist
hybrist / a-minimal.zb
Last active August 29, 2015 14:24
Minimal interesting Zoidberg program
getName() {
&"Quinn";
}
# Result:
#
# async function getName() {
# return Promise.resolve("Quinn");
# }
@hybrist
hybrist / bisector.sh
Last active January 8, 2016 19:55
CLS failure on iojs >= 1.8.4 (possibly earlier)
#!/usr/bin/env bash
./configure
make -j4
./iojs cls-failure.js
@hybrist
hybrist / trailing-whitespace.diff
Created August 20, 2015 17:48
Devtools doesn't format JSON responses when they have trailing whitespace
diff --git a/Source/devtools/front_end/network/RequestJSONView.js b/Source/devtools/front_end/network/RequestJSONView.js
index f88c212..a5b3eed 100644
--- a/Source/devtools/front_end/network/RequestJSONView.js
+++ b/Source/devtools/front_end/network/RequestJSONView.js
@@ -152,7 +152,7 @@ WebInspector.RequestJSONView.parseJSON = function(text)
text = text.substring(inner.start, inner.end + 1);
// Only process valid JSONP.
- if (suffix.length && !(suffix.trim().startsWith(")") && prefix.trim().endsWith("(")))
+ if (suffix.trim().length && !(suffix.trim().startsWith(")") && prefix.trim().endsWith("(")))
@hybrist
hybrist / node-v4.sh
Created September 9, 2015 19:02
node 4 recipe
VERSION=$1
PACKAGE_TAG=node-${VERSION}
curl -sSo ${PACKAGE_TAG}-linux-x64.tar.gz "https://nodejs.org/dist/${VERSION}/${PACKAGE_TAG}-linux-x64.tar.gz"
tar -xzf ${PACKAGE_TAG}-linux-x64.tar.gz
mv ${PACKAGE_TAG}-linux-x64 ${PACKAGE_TAG}
./${PACKAGE_TAG}/bin/node -v
rm ${PACKAGE_TAG}/README.md ${PACKAGE_TAG}/CHANGELOG.md ${PACKAGE_TAG}/LICENSE
tar -cvzf ${PACKAGE_TAG}.tar.gz ${PACKAGE_TAG}
curl --upload-file $PACKAGE_TAG.tar.gz http://config/package/$PACKAGE_TAG.tar.gz