Skip to content

Instantly share code, notes, and snippets.

NODE_TLS_REJECT_UNAUTHORIZED=0
@andrewdacenko
andrewdacenko / npm_clean_modules.sh
Created January 26, 2016 15:08
Uninstall all `npm` packages for project
for package in `ls node_modules`; do npm uninstall $package; done;
@andrewdacenko
andrewdacenko / clean-boot.sh
Last active August 29, 2015 14:17
Get list of linux images and delete old from /boot
# run it with root user `sudo -s`
dpkg --get-selections|grep 'linux-image*'|awk '{print $1}'|egrep -v "linux-image-$(uname -r)|linux-image-generic" |while read n;do apt-get -y remove $n;done
@andrewdacenko
andrewdacenko / inherit.js
Last active August 29, 2015 14:16
JavaScript Inheritance
function A(x) {
this.x = x;
};
A.prototype = {
log: function () {
console.log('A', this.x);
}
};
@andrewdacenko
andrewdacenko / .bowerrc.json
Created December 17, 2014 12:27
Bower disable strict ssl to prevent CERT_UNTRUSTED
{
"directory": "bower_components",
"registry": "http://bower.herokuapp.com",
"strict-ssl": false
}
@andrewdacenko
andrewdacenko / console.js
Last active August 29, 2015 14:07
console.js
/**
* Example
* var colors = ['#f00', '#0f0', 'rgb(0, 0, 255)'];
* console.color(colors);
*/
console.color = function(arr) {
var colorString = arr.map(function(c) {
return "%c" + c;
}).join("\n");