Skip to content

Instantly share code, notes, and snippets.

View alexanderjeurissen's full-sized avatar

Alexander Jeurissen alexanderjeurissen

View GitHub Profile
; .editorconfig
root = true
[**.js]
brace_style = collapse, end-expand, expand-strict
break_chained_methods = false
e4x = false
eval_code = false
indent_style = space
@alexanderjeurissen
alexanderjeurissen / Scale.js
Created February 27, 2014 16:56
This function scales the given value from one domain to another. scale( [a,b] , [min,max] , a ) = min AND scale( [a,b] , [min,max] , b ) = max
var scale = function (sourceDomain, targetDomain, x) {
var sourceMin = sourceDomain[0];
var sourceMax = sourceDomain[1];
var targetMin = targetDomain[0];
var targetMax = targetDomain[1];
return {
value: (((targetMax - targetMin) * (x - sourceMin)) / (sourceMax - sourceMin)) + targetMin,
scalingFactor: (targetMax - targetMin) / (sourceMax - sourceMin)
@alexanderjeurissen
alexanderjeurissen / charCodes.coffee
Last active August 29, 2015 13:56
A string prototype that returns an array of char codes for the given string.
String::charCodes = ->
@split("").reduce (previousValue, currentValue, index, array) ->
array[index] = currentValue.charCodeAt 0
array
, 0
@alexanderjeurissen
alexanderjeurissen / toBinary.coffee
Created March 2, 2014 23:54
String prototype that converts the given message to a binary String.
//coffescript version
String::toBinary = ->
@split("").reduce (result, char) ->
bin = char.charCodeAt(0).toString(2)
result += "00000000".slice(0, 8 - bin.length) + bin
, ""
#GistID:9526183
# javascript
node_modules
coverage
dist
.tmp
npm-debug.log
app/bower_components
*.tern.project
#GistID:9531777
[user]
name = Alexander Jeurissen
email = alexanderjeurissen@gmail.com
[diff]
external = git_diff_wrapper
[pager]
diff =
[color]
ui = auto
#GistID: 9818509
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
{
"node" : true,
"browser" : true,
"es5" : false,
"esnext" : true,
"bitwise" : true,
"camelcase": true,
"curly" : true,
"eqeqeq" : true,
"immed" : true,
#!/bin/sh
echo $*
vimdiff "$1" "$2"
# GistID: 10715991
StringLiterals:
EnforcedStyle: double_quotes
Enabled: true
Style/ClassLength:
CountComments: false # count full line comments?
Max: 150
Documentation:
Enabled: false