- System wide PATH configuration
Edit /etc/environment
with:
PATH='/foo/bar:'$PATH
/** | |
Better Javascript Mouse Events | |
Author: Casey Childers | |
https://jsfiddle.net/BNefn/ | |
**/ | |
(function(){ | |
// use addEvent cross-browser shim: https://gist.github.com/dciccale/5394590/ | |
var addEvent = function(a,b,c){try{a.addEventListener(b,c,!1)}catch(d){a.attachEvent('on'+b,c)}}; | |
/* This function detects what mouse button was used, left, right, middle, or middle scroll either direction */ |
var $_GET = {}; | |
if(document.location.toString().indexOf('?') !== -1) { | |
var query = document.location | |
.toString() | |
// get the query string | |
.replace(/^.*?\?/, '') | |
// and remove any existing hash string (thanks, @vrijdenker) | |
.replace(/#.*$/, '') | |
.split('&'); |
#!/bin/sh | |
cp_p() | |
{ | |
strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \ | |
| awk '{ | |
count += $NF | |
if (count % 10 == 0) { | |
percent = count / total_size * 100 | |
printf "%3d%% [", percent | |
for (i=0;i<=percent;i++) |
function read_cookie(key){ | |
var result; | |
return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? (result[1]) : null; | |
} |
function merge(A, B, depth) { | |
if ( typeof target !== 'object' ) { | |
target = {}; | |
} | |
for (var property in source) { | |
if ( source.hasOwnProperty(property) ) { | |
var sourceProperty = source[ property ]; | |
if ( typeof sourceProperty === 'object' ) { | |
target[ property ] = merge( target[ property ], sourceProperty ); |
// FROM http://stackoverflow.com/questions/728360/most-elegant-way-to-clone-a-javascript-object | |
// When I had to implement general deep copying I ended up compromising by | |
// assuming that I would only need to copy a plain Object, Array, Date, String, | |
// Number, or Boolean. The last 3 types are immutable, so I could perform a | |
// shallow copy and not worry about it changing. I further assumed that any | |
// elements contained in Object or Array would also be one of the 6 simple | |
// types in that list. This can be accomplished with code like the following: | |
function clone(obj) { |
// http://davidwalsh.name/javascript-clone | |
function clone(src) { | |
function mixin(dest, source, copyFunc) { | |
var name, s, i, empty = {}; | |
for(name in source){ | |
// the (!(name in empty) || empty[name] !== s) condition avoids copying properties in "source" | |
// inherited from Object.prototype. For example, if dest has a custom toString() method, | |
// don't overwrite it with the toString() method that source inherited from Object.prototype | |
s = source[name]; | |
if(!(name in dest) || (dest[name] !== s && (!(name in empty) || empty[name] !== s))){ |
[ | |
{ "keys": ["ctrl+tab"], "command": "next_view" }, | |
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }, | |
{ "keys": ["ctrl+shift+s"], "command": "prompt_save_as" }, | |
{ "keys": ["ctrl+shift+a"], "command": "expand_selection", "args": {"to": "tag"} }, | |
] |
// statistics counter animation | |
var counterFx = function counterFx(element) { | |
var dfd = element.map(function(i, el) { | |
var data = parseInt(this.dataset.value.replace(/[\.,]+/g, '')); | |
var props = { | |
"from": { | |
"count": 0 | |
}, | |
"to": { | |
"count": data |