In Javascript this
is bound in unexpected ways. Functions, in particular, create a new 'this' and so when you want to keep a reference to an "outer" object you sometimes see the pattern:
var self = this;
as in:
var self = this;
pi@raspberrypi:~/Documents/RaspAlarm $ webpack | |
Hash: 37ee781105d39d10c02e | |
Version: webpack 1.14.0 | |
Time: 29708ms | |
Asset Size Chunks Chunk Names | |
public/bundle.js 1.39 MB 0 [emitted] main | |
+ 357 hidden modules | |
ERROR in ./app/components/Main.js | |
Module not found: Error: Cannot resolve 'file' or 'directory' ../../private/keys.js in /home/pi/Documents/RaspAlarm/app/components |
// Searches current directory recursively using extended regular expressions for Hex Codes i.e. : | |
// Single or double quote group+maybe a # sign+xdigits with a range of 6+ single or double quote group | |
grep -rE --color "(\'|\")#?[[:xdigit:]]{6,6}(\'|\")" . |
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//' |
find ~/<directory> -exec file -b --mime-type {} + | sort | uniq -c | sort -nr |
/*! | |
* Dynamically changing favicons with JavaScript | |
* Works in all A-grade browsers except Safari and Internet Explorer | |
* Demo: http://mathiasbynens.be/demo/dynamic-favicons | |
*/ | |
// HTML5™, baby! http://mathiasbynens.be/notes/document-head | |
document.head || (document.head = document.getElementsByTagName('head')[0]); | |
function changeFavicon(src) { |
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
} | |
NodeList.prototype.__proto__ = Array.prototype; |
for f in *; do mv "$f" `echo $f | tr ' ' '_'`; done |
svn st | awk '$1 == "M"{print $2;}'| xargs svn diff |