sudo apt-get install autoconf autopoint automake gettext git groff pkg-config texinfo gcc make libncursesw5-dev
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
parseEmails: function (emailStr) { | |
// remove RFC-822 adornments & normalize delimiters | |
var rfc822Cleaner = /(?:"[^@"'<>]*?"|(?:^|\n| |,|;)(?:[^@"'<>])+?)\s*?<([-a-z0-9_.%+]+?@[-a-z0-9.]+?.[-a-z0-9]{2,63}?)>/gi, | |
exchangeCleaner = /"(?:[^@"()])*?\(([-a-z0-9_.%+]+?@[-a-z0-9.]+?.[-a-z0-9]{2,63})\)(?:[^@"()])*?"\s*?<\1>/gi, | |
cleanedStr = emailStr.replace(rfc822Cleaner, ' $1 ').replace(exchangeCleaner, ' $1 ').replace(/(\n|[;, ])+/g, ';'), | |
emailList = _.split(cleanedStr, ';'); | |
var re = /(?:^|\s|\n|[;,<"'(])([-a-z0-9_.%+]+@[-a-z0-9.]+?.[-a-z0-9]{2,63})(?:^|\s|\n|[;,>"')])/gi, | |
emails = [], | |
dummy = emailStr.replace(re, function (match, email) { emails.push(email); return '[' + email + ']';}); |
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 python3 | |
import os, sys, re | |
skip = re.compile(sys.argv[3] if len(sys.argv) > 3 else '$.') | |
def compare_dirs(d1: "old directory name", d2: "new directory name"): | |
def print_local(a, msg): | |
print('DIR ' if a[2] else 'FILE', a[1], msg) | |
# ensure validity |
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 geti (value, prop) { | |
if (_.isPlainObject(value)) { | |
if (_.isString(prop) && prop !== '') { | |
return geti(value, prop.split('.')); | |
} else if (_.isArray(prop) && prop.length) { | |
const key = _.toLower(prop.shift()), | |
val = Object.keys(value).reduce(function (a, k) { | |
if (a !== undefined) { | |
return a; | |
} |
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 humanizeDuration ($secs) { | |
$secs = ($secs<1)? 1 : $secs; | |
$tokens = array ( | |
31536000 => 'year', | |
2592000 => 'month', | |
604800 => 'week', | |
86400 => 'day', | |
3600 => 'hour', | |
60 => 'minute', | |
1 => 'second' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
##### Prerequisites | |
# | |
# * brew | |
# * xcode command line tools | |
# | |
### brew installs | |
brew install automake autoconf pkg-config gettext ncurses | |
### Add env vars - ~/.bashrc or ~/zshrc if you are a zsh user |
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
<div id="twt-comments"></div> | |
<script> | |
document.querySelectorAll('#ArchiveList .posts a').forEach(function (a) { | |
var span = document.createElement('span'); | |
span.setAttribute('twt-comment-count', a.getAttribute('href')); | |
a.insertAdjacentHTML('beforeend', ' ['); | |
a.insertAdjacentElement('beforeend', span); | |
a.insertAdjacentHTML('beforeend', ']'); | |
}); | |
h2 = document.querySelector('.main .date-header'); |
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
<!doctype html> | |
<html> | |
<head> | |
<link rel="shortcut icon" href="//scalora.net/ticon.png"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | |
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> |
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
const escapeChars = { '¢' : 'cent', '£' : 'pound', '¥' : 'yen', '€': 'euro', '©' : 'copy', '®' : 'reg', '<' : 'lt', '>' : 'gt', '"' : 'quot', '&' : 'amp', '\'' : '#39'}, | |
htmlEncode = function (s) { | |
return s.replace(/[\u00A0-\u9999<>\&'"]/gim, function (i) { | |
return `&${escapeChars[i] || '#' + i.charCodeAt(0)};`; | |
}); | |
}; |