As configured in my dotfiles.
start new:
tmux
start new with session name:
<?php | |
define('THRESHOLD', 80); | |
$res = shell_exec('/bin/df -h | /bin/grep \'/dev/sda2\' | /usr/bin/awk \'{print $5}\''); | |
$res = floatval(str_replace('%', '', trim($res))); | |
if($res > THRESHOLD){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'https://hooks.slack.com/services/T01234567/B11234567/123456712345671234567'); | |
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode([ |
sudo apt-get update -y | |
sudo apt-get install -y git | |
sudo gem install sass | |
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 | |
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org | |
sudo apt-get install -y build-essential tcl8.5 | |
wget http://download.redis.io/releases/redis-stable.tar.gz |
WARNING: the code that follows will make you cry; a safety pig is provided below for your benefit. | |
_ | |
_._ _..._ .-', _.._(`)) | |
'-. ` ' /-._.-' ',/ | |
) \ '. | |
/ _ _ | \ | |
| a a / | | |
\ .-. ; | |
'-('' ).-' ,' ; |
_ | |
_._ _..._ .-', _.._(`)) | |
'-. ` ' /-._.-' ',/ | |
) \ '. | |
/ _ _ | \ | |
| a a / | | |
\ .-. ; | |
'-('' ).-' ,' ; | |
'-; | .' | |
\ \ / |
// A thing I want to do | |
// This flow only involves **one** promise, for example an ajax call | |
// None of the subsequent `then` or `catch` calls, return new promises. | |
var explode = false; | |
var promise = new Promise(function(resolve, reject) { | |
if (explode) { |
// --- Compiling --- | |
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz | |
$ tar xzvf redis-2.8.3.tar.gz | |
$ cd redis-2.8.3 | |
$ make | |
$ make install | |
// --- or using yum --- | |
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
/* arrows */ | |
.arrow-right {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAJUlEQVR42mNgAILy8vL/DLgASBKnApgkVgXIkhgKiNKJ005s4gDLbCZBiSxfygAAAABJRU5ErkJggg==") no-repeat scroll 0 0 transparent} | |
.arrow-bottom {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAG0lEQVR42mNgwAfKy8v/48I4FeA0AacVDFQBAP9wJkE/KhUMAAAAAElFTkSuQmCC") no-repeat scroll 0 0 transparent} |
As configured in my dotfiles.
start new:
tmux
start new with session name:
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
killall ssh-agent; eval `ssh-agent` |