chown -R <user>:<group> <pathToFileOrDirectory>
(-R to recursively change permission to a folder)
Nice blog explaining user management on Linux: https://www.linode.com/docs/tools-reference/linux-users-and-groups
function query(selector, context) { | |
context = context || document; | |
// Redirect simple selectors to the more performant function | |
if (/^(#?[\w-]+|\.[\w-.]+)$/.test(selector)) { | |
switch (selector.charAt(0)) { | |
case '#': | |
// Handle ID-based selectors | |
return [context.getElementById(selector.substr(1))]; | |
case '.': | |
// Handle class-based selectors |
// Does not handle hidden files like .htaccess the way you would want though ;) | |
getFileExtension (filename) { | |
let res = filename.substr(filename.lastIndexOf('.')+1); | |
return res === filename ? '' : res; | |
} |
# Advanced Aliases. | |
alias c='clear' | |
# ls, the common ones I use a lot shortened for rapid fire usage | |
alias l='ls -lFh' #size,show type,human readable | |
alias la='ls -lAFh' #long list,show almost all,show type,human readable | |
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable | |
alias lt='ls -ltFh' #long list,sorted by date,show type,human readable | |
alias ldot='ls -ld .*' |
let img = new Image(); | |
img.onload = () => { | |
console.log('youpiiii img preloaded !') | |
}; | |
img.src = 'some_url'; |
import { modulo } from "./utils"; | |
export class Pager { | |
next:number = 0; | |
previous:number = 0; | |
constructor(public current:number = 0, public length:number = 0, noModulo:boolean = false) { | |
this.setNeighbours(noModulo); | |
} |
chown -R <user>:<group> <pathToFileOrDirectory>
(-R to recursively change permission to a folder)
Nice blog explaining user management on Linux: https://www.linode.com/docs/tools-reference/linux-users-and-groups
/** | |
* Returns a value always between 0 and size - 1. | |
* @param a current index | |
* @param b size | |
*/ | |
export function modulo(a, b) { return (+a % (b = +b) + b) % b; }; |
img[alt] { | |
position: relative; | |
&:after { | |
display: block; | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
/* Add bg color and the text of the alt attribute in place of the broken image */ |
To completely uninstall node + npm is to do the following:
/usr/local/lib
and delete any node
and `node_modules/usr/local/include
and delete any node
and node_modules
directorybrew install node,
then run brew uninstall node
in your terminallocal
or lib
or include
folders, and delete any node
or node_modules
from there/usr/local/bin
and delete any node executablesudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules