Access your local development servers by human-readable domain name instead of
numerical IP without touching your /etc/hosts
.
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
{ | |
"data": { | |
"type": "account", | |
"attributes": { | |
"name": "Виталий", | |
"phone": "+375 29 335-86-79" | |
} | |
} | |
} |
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 bash | |
#: usage: pew [<options>] [<command>] | |
#: | |
#: Manage vault with easy. | |
#: | |
#: The most commonly used commands are: | |
#: pew Show vault | |
#: pew <re> Search by regular expression | |
#: pew --help Show list of available commands and exit. |
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 bash | |
# | |
#: usage: mac <string> | |
#: | |
#: Returns the unique and valid MAC address in format 00:16:3E:xx:xx:xx. | |
#: The <string> uses to create an unique part of the address. | |
function help() { | |
sed -En 's/^#:[[:space:]]?//p' $0 | |
} |
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 bash | |
# | |
#: usage: bump <version> <upcoming> | |
#: | |
#: For each file in current directory and subdirectories | |
#: update any <version> string to the new <upcoming> value. | |
function help() { | |
sed -En 's/^#:[[:space:]]?//p' $0 | |
} |
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
// Define variables in one `var` statement | |
var | |
// The our API implementation | |
api = {}, | |
// The basic API endpoint | |
apiRoot = document.location.protocol + '//' + document.location.host + '/api/v1/', | |
// Verb aliases |
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 _tr() { | |
local cur="${COMP_WORDS[COMP_CWORD]}" | |
COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$(tmux -q list-sessions | cut -f 1 -d ':')" -- "${cur}") ) | |
} | |
complete -F _tr tr |
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 | |
# tmux completion | |
# See: http://www.debian-administration.org/articles/317 for how to write more. | |
# Usage: Put "source bash_completion_tmux.sh" into your .bashrc | |
# Based upon the example at http://paste-it.appspot.com/Pj4mLycDE | |
function _tmux_complete_client() { | |
local IFS=$'\n' | |
local cur="${1}" |
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 bash | |
# Usage: git-branch-status | |
# Show how many commits each branch is ahead or behind its upstream. | |
branch=`git rev-parse --abbrev-ref HEAD` | |
git for-each-ref --format='%(refname:short) %(upstream:short)' refs/heads | \ | |
while read local upstream; do |
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(name, definition) { | |
var hasDefine = typeof define === 'function', | |
hasExports = typeof module !== 'undefined' && module.exports; | |
if (hasDefine) { | |
define(name, definition); | |
} else if (hasExports) { | |
module.exports = definition(); | |
} else { | |
this[name] = definition(); |