This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Functional Programming example in PHP | |
<?php | |
function myFoo($foo){ | |
return function ($bar) use ($foo){ | |
return "Foo is ${foo} and Bar is ${bar}"; | |
}; | |
} | |
//first call set $foo = 'Asd' | |
$myBarAsd = myFoo('Asd'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function instanceof Object // true | |
Boolean instanceof Function // true | |
Number instanceof Function // true | |
String instanceof Function // true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b = new Boolean(false); // { [[PrimitiveValue]]: false } | |
var n = new Number(10); // { [[PrimitiveValue]]: 10 } | |
var s = new String('foo'); // { 0: "f", 1: "o", 2: "o", length: 3, [[PrimitiveValue]]: "foo" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b = Boolean(false); // false | |
var n = Number(10); // 10 | |
var s = String("foo"); // "foo" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Boolean(""); // false | |
Boolean(0); // false | |
Boolean(1); // true | |
Number("10"); // 10 | |
Number("foo"); // NaN | |
String(10); // "10" | |
var stuff = ["", 1, undefined, { foo: "bar" }]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Boolean(myVar) === !!myVar // true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function curry(f) { | |
return function currify() { | |
const args = Array.prototype.slice.call(arguments); | |
return args.length >= f.length ? | |
f.apply(null, args) : | |
currify.bind(null, ...args) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Comment next lines depending on your environment | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
# COLORS PROFILES START | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
autoload -U colors && colors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example for node | |
git submodule foreach "npm i || :" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// Documentation at https://www.sublimetext.com/docs/color_schemes.html | |
{ | |
"variables": | |
{ | |
"yellow": "#F0DB4F", | |
"function_argument": "#79b8ff", | |
"variable_blue": "#9ecbff", | |
}, | |
"globals": | |
{ |
OlderNewer