I hereby claim:
- I am ahultgren on github.
- I am ahultgren (https://keybase.io/ahultgren) on keybase.
- I have a public key whose fingerprint is 270E BFC7 7B5D C59D 1422 3466 DA26 60E7 34DF 1FD7
To claim this, I am signing this object:
var Connection = require('ssh2'); | |
var conn = new Connection(); | |
conn.on('ready', function() { | |
exec(conn, 'pwd', function () { | |
exec(conn, 'pwd', function () { | |
conn.end(); | |
}); | |
}); | |
}); |
I hereby claim:
To claim this, I am signing this object:
var Connection = require('ssh2'), | |
net = require('net'); | |
var conn1 = new Connectiweon(), | |
conn2 = new Connection(); | |
conn1.on('ready', function() { | |
console.log('FIRST :: connection ready'); | |
conn1.exec('nc github.com 22', function(err, stream) { | |
if (err) return console.log('FIRST :: exec error: ' + err); |
(function (exports) { | |
function validatePersonnummer (personnummer) { | |
// Ensure string in case of number | |
personnummer = "" + personnummer; | |
// Trim non-digits | |
// This discards (and thus accepts) any non-digits anywhere in the personnummer. | |
// Depending on your case, that might not be the desired behavior. | |
personnummer = personnummer.replace(/[^\d]/g, ''); |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
sprite: { | |
icons: { | |
src: 'img/icons/*.{png,jpg,gif}', | |
destImg: 'img/icons.png', | |
destCSS: 'less/general/icons.less', | |
algorithm: 'binary-tree', | |
cssTemplate: 'path/to/icon.template.mustache' |
function cloneFn (fn) { | |
var args, | |
strFn = fn.toString(); | |
// Extract argument names | |
// Match first occurence of "(<anything but end-parenthesis>)", | |
// split it on "," and use as args | |
args = [Function].concat(strFn | |
.match(/\(([^\)]*)\)/)[1] | |
.trim() |
Once upon a time there was a show where a guest could win The Grand Prize™. To do so he/she just had to pick one box of three. Of these three boxes, two were empty. Thus, only one very randomly chosen box contained the grand prize. When the guest had picked a box of his/her liking, however, there was a twist. The host of the show, who knew which box was the very randomly chosen one, would remove a box that was empty. Now the guest was faced with the option to keep the already picked box, or swap to the other one. What is the correct thing to do?
Well, according to common sense, it really shouldn't matter. Math disagrees though. According to math, since we from the beginning know that the chosen box had 1/3 chance of containing the grand prize, and the second box is removed, the last one has to have the rest of the 2/3s of chance. Since this is obviously ridiculous I decided to once and for all, for the greater sanity of the world, actually test it.
And, in short, to the dismay of my common sense, math preva
"use strict"; | |
var accents = 'àáäâæåèéëêęìíïîòóöôøœōõùúüûūýçñ', | |
normals = 'aaaaaaeeeeeiiiioooooooouuuuuycn', | |
diacriticsRegexp = new RegExp('[' + accents + ']', 'ig'); | |
module.exports = exports = function undiacritics (string) { | |
return string.replace(diacriticsRegexp, function(s){ | |
return normals[accents.indexOf(s)]; | |
}); |
var chars = { | |
numbers: "123456789", | |
letters: "qwertyupasdfghjkzxcvbnm", | |
upper: "qwertyupasdfghjkzxcvbnm".toUpperCase(), | |
special: "!#€%&/@\\(){}[]=?`´^¨*,.;:-_><§°", | |
foreign: "ñõìàéèëêãâîïÇÉçéûüåäöæø", | |
foreignUpper: "ñõìàéèëêãâîïÇÉçéûüåäöæø".toUpperCase(), | |
ambigious: "”\"'’“iloILO0 ", | |
insane: "¡¥¢‰¶≠¿•˝√‡˜ˆŒ∏»«ˇ⁄—·◊∑∆∫¯˘¬ºflØÆ⁄ˇ≥Ω鮆µüıœπ˙ß∂ƒ¸˛ªfi÷≈ç‹›‘‚…" | |
}; |
set fish_git_dirty_color red | |
set fish_git_clean_color brown | |
function parse_git_dirty | |
if test (git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" | |
echo (set_color $fish_git_dirty_color) | |
else | |
echo (set_color $fish_git_clean_color) | |
end | |
end | |
function fish_prompt --description 'Write out the prompt' |