Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
// See https://github.com/promises-aplus/promises-spec/issues/179
@hax
hax / dabblet.css
Last active August 29, 2015 14:13
Untitled
header {
color: white;
background: navy;
height: 60px;
position: fixed;
left: 0;
right: 0;
top: 0;
}
@hax
hax / koa-confusing-accessors.js
Last active August 29, 2015 14:00
confusing accessors in koa
// See https://github.com/koajs/koa/issues/215
// start: nvm run 0.11 --harmony koa-confusing-accessors
// test: curl -d '{"test":"ok"}' -H 'Content-Type: application/json' http://localhost:3000/
var koa = require('koa');
var app = module.exports = koa();
app.use(function *(next){
if (this.method === 'POST') {
this.body = '<?xml version="1.0">'
@hax
hax / intl-typehint-bug.php
Last active August 29, 2015 13:57
typehint bug of Intl extension in PHP 5.5
<?php
$f = new ReflectionFunction('intltz_from_date_time_zone');
var_dump($f->getParameters()[0]->getClass()); // cause ReflectionException in PHP 5.5
/*
run `php --rf intltz_from_date_time_zone` =>
Function [ <internal:intl> function intltz_from_date_time_zone ] {
- Parameters [1] {