Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Dacenko andrewdacenko

View GitHub Profile
@andrewdacenko
andrewdacenko / npm_clean_modules.sh
Created Jan 26, 2016
Uninstall all `npm` packages for project
View npm_clean_modules.sh
for package in `ls node_modules`; do npm uninstall $package; done;
@andrewdacenko
andrewdacenko / clean-boot.sh
Last active Aug 29, 2015
Get list of linux images and delete old from /boot
View clean-boot.sh
# 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 Aug 29, 2015
JavaScript Inheritance
View inherit.js
function A(x) {
this.x = x;
};
A.prototype = {
log: function () {
console.log('A', this.x);
}
};
@andrewdacenko
andrewdacenko / .bowerrc.json
Created Dec 17, 2014
Bower disable strict ssl to prevent CERT_UNTRUSTED
View .bowerrc.json
{
"directory": "bower_components",
"registry": "http://bower.herokuapp.com",
"strict-ssl": false
}
View 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");