I hereby claim:
- I am hugowetterberg on github.
- I am hugo_wetterberg (https://keybase.io/hugo_wetterberg) on keybase.
- I have a public key ASD3IFtKQe-HrHLTQv01rHzYdxTr_3H7P07qSHdyu_Jyggo
To claim this, I am signing this object:
package main | |
// Example to illustrate fan-out fan-in processing with batched writes, bounded | |
// queues, and backpressure for controlling the workload that the process takes | |
// on. | |
import ( | |
"crypto/sha256" | |
"fmt" | |
"os" |
#!/bin/bash | |
set -e | |
exec 3>&1 # make stdout available as fd 3 for the result | |
exec 1>&2 # redirect all output to stderr for logging | |
image=$1 | |
debug='n' | |
# Check if the first parameter was '-v' then we check for the image in |
I hereby claim:
To claim this, I am signing this object:
function fixup(a, b) { | |
console.log(a, '=>', b); | |
var add = []; | |
var remove = []; | |
for (var i = 0; i < a.length; i++) { | |
if (b.indexOf(a[i]) == -1) { | |
remove.push(a[i]); | |
} | |
} | |
for (var i = 0; i < b.length; i++) { |
// https://github.com/beatgammit/base64-js | |
var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
;(function (exports) { | |
'use strict' | |
var Arr = (typeof Uint8Array !== 'undefined') | |
? Uint8Array | |
: Array |
function test() { | |
for (var i=0;i < 5;i++) { | |
console.log('orig: '+ i); | |
doStuff(i); | |
} | |
function doStuff(i) { | |
setTimeout(function debugLogging() { | |
console.log('cb: '+ i); | |
}, 100); |
// Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where | |
// x is any hexadecimal digit and y is one of 8, 9, A, or B (e.g., | |
// f47ac10b-58cc-4372-a567-0e02b2c3d479). | |
// See: http://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 | |
function uuid() { | |
var reservedBitValues = ['8','9','a','b']; | |
return Array.prototype.map.call("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", function mapUUID(c) { | |
if (c == "x") { | |
return Math.round(Math.random()*16-0.5).toString(16); | |
} |
var hasLanguage = true; | |
var lang = { | |
greeting: 'Hello __name__, welcome to __placeHTML__!' | |
}; | |
var langReplace = /__([^\s]+)__/g; | |
var entityReplace = /[<>&]/g; | |
var entities = { | |
'<': '<', | |
'>': '>', |
<?php | |
define('JSON_STREAM_ERROR_OOO', 1); | |
class JsonStreamException extends Exception { | |
private $json_state; | |
public function __construct($message = "", $code = 0, $state = NULL, $previous = NULL) { | |
parent::__construct($message, $code, $previous); | |
$this->json_state = $state; | |
} |
### | |
Converts the distance between the WGS 84 coordinates pointA and pointB to meters. | |
Ported from http://groups.google.com/group/sci.geo.satellite-nav/msg/0bfca0bf8a986395 | |
with the suggested radii-calculation optimization. | |
### | |
module.exports.WGS84DegreesToMeters = (pointA, pointB)-> | |
radFactor = Math.PI/180 | |
[lat1, lon1] = [pointA[0]*radFactor, pointA[1]*radFactor] | |
[lat2, lon2] = [pointB[0]*radFactor, pointB[1]*radFactor] |