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 set-title() { | |
if [[ -z "$ORIG" ]]; then | |
ORIG=$PS1 | |
fi | |
TITLE="\[\e]2;$*\a\]" | |
PS1=${ORIG}${TITLE} | |
} |
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
export interface IResponse<T> { | |
Message: string | |
IsError: boolean | |
Data: T | |
} |
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 alphanum = "aAbBcCdDeEfFgGHhIIJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789".split(""); | |
export const random: (size: number, prefix: string | null) => string = (size, prefix = null) => { | |
if(prefix && prefix.length > size) return throw("size must be greater than prefix length") | |
const result = []; | |
for (let i = 0; i < size; i++) { | |
result.push(alphanum[Math.floor(Math.random() * alphanum.length)]); | |
} | |
const base = result.join(""); | |
if (!prefix) return base; |
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
<script type="text/template" id="tmpl-cell"> | |
<div class="input mb-2"> | |
<input data-bind="value: character, attr: {id: 'clip-'+name(), 'data-clipboard-target':'#clip-'+name(), title: name()}" type="text" class="form-control box1" placeholder="" aria-label="" aria-describedby="basic-addon1"> | |
</div> | |
</script> | |
<script type="text/template" id="tmpl-snippet"> | |
<div> |
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 _ = require( 'lodash' ), | |
async = require( 'async' ), | |
fs = require('fs') | |
; | |
var actions, base, result, states, subActions, template, toObject, types; | |
result = {}; | |
template = `module.exports = ${JSON.stringify(_.omit(result, 'any'), '', 4)}`; | |
base = [ '*' ]; |
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
var | |
WAIT_TIMER = 1750, // in MS | |
waitForItTimer, | |
waitForIt, whatYoureWaitingToInvoke; | |
whatYoureWaitingToInvoke = function _whatYoureWaitingToInvoke() { | |
alert(`what you're waiting for!!`); | |
}; | |
waitForIt = function _waitForIt() { |
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
# source https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04 | |
sudo apt-get update | |
sudo apt-get install nginx | |
# options 'Nginx HTTP', 'Nginx HTTPS', 'Nginx Full' | |
sudo ufw allow 'Nginx HTTP' |
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
# source https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04 | |
# as of 23/4/2017 | |
#part 1 | |
# add build deps | |
sudo apt-get update | |
sudo apt-get -y install build-essential libssl-dev | |
# grab v0.33.1 (most recent) |
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
# instructions from https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04 | |
# Add the GPG key for the official Docker repository to the system | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
# Add the Docker repository to APT sources: | |
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | |
# Update the package database with the Docker packages from the newly added repo: | |
sudo apt-get update |
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 | |
# java 8 | |
# get the package | |
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.3.2.deb | |
# unpack | |
sudo dpkg -i elasticsearch-2.3.2.deb |
NewerOlder