start new:
tmux
start new with session name:
tmux new -s myname
NS_INLINE NSRange NSRangeMake(NSUInteger loc, NSUInteger len) { | |
return NSMakeRange(loc, len); | |
} | |
NS_INLINE NSUInteger NSRangeMax(NSRange range) { | |
return NSMaxRange(range); | |
} | |
NS_INLINE BOOL NSRangeContainsLocation(NSUInteger loc, NSRange range) { | |
return NSLocationInRange(loc, range); |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
# build output dirs | |
BUILD_DIR = build | |
JS_BUILD_DIR = $(BUILD_DIR)/js | |
CSS_BUILD_DIR = $(BUILD_DIR)/css | |
IMG_BUILD_DIR = $(BUILD_DIR)/img | |
VENDOR_BUILD_DIR = $(BUILD_DIR)/vendor | |
TESTS_BUILD_DIR = test/build | |
# sources | |
TEMPLATES = $(shell find app -name '*.hbs') |
/** | |
* Stand alone polyfill allow only numbers on input of type number. | |
* | |
* While input filtering is already supported by default by some browsers, maximum length has not been implemented by | |
* any. This script will solve both issue and make sure that only digits can be entered in input elements of type | |
* number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on | |
* input of type text. | |
* | |
* Supports: | |
* |
man() { | |
env \ | |
LESS_TERMCAP_mb=$(printf "\e[1;31m") \ | |
LESS_TERMCAP_md=$(printf "\e[1;31m") \ | |
LESS_TERMCAP_me=$(printf "\e[0m") \ | |
LESS_TERMCAP_se=$(printf "\e[0m") \ | |
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ | |
LESS_TERMCAP_ue=$(printf "\e[0m") \ | |
LESS_TERMCAP_us=$(printf "\e[1;32m") \ | |
man "$@" |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.