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
[user] | |
#git config --global alias.lol "log --oneline --graph --decorate" | |
email = xxxxx | |
name = XXX XXX | |
[core] | |
editor = vim | |
pager = diff-so-fancy | less --tabs=4 -RFX | |
[alias] | |
purge = !git branch -D $1 && git push origin :$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
netstat -tulpn | |
netstat -polenta | |
#ask for www.foo.baz | |
dig +short www.foo.baz | |
#ask at 208.67.222.222 for foo.baz MX | |
dig @208.67.222.222 foo.baz MX | |
ps axfww | |
tcpdump -n -S -s 0 -A 'tcp dst port 80' and src 172.31.4.7 | |
# kill by port | |
PORT=3030 |
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 | |
dir=${1:-$PWD} | |
find "$dir" -type f -name "*.mp4" | sort | awk -F\/ ' | |
$7 ~ /^[0-9]{1,2}/ { | |
folder=gensub(/^[^0-9]*([0-9]+).*$/,"\\1","G", $7) | |
idx=gensub(/^[^0-9]*([0-9]+).*$/,"\\1","G", $8) | |
# arr[folder][length(arr[folder])+1]=$0 #auto incremental idx | |
arr[folder][idx]=$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
const Module = require('module') | |
const originalRequire = Module.prototype.require | |
const Redis = require('ioredis-mock') | |
Module.prototype.require = function () { | |
const filePath = Array.prototype.concat.apply([], arguments)[0] | |
if (!filePath.includes('setup/redis')) { | |
return originalRequire.apply(this, arguments) | |
} |
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
// https://github.com/KunalKapadia/express-mongoose-es6-rest-api | |
// print mongoose logs in dev env | |
if (config.MONGOOSE_DEBUG) { | |
mongoose.set('debug', (collectionName, method, query, doc) => { | |
debug(`${collectionName}.${method}`, util.inspect(query, false, 20), doc); | |
}); | |
} |
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
<?php | |
// _block_render_blocks: | |
$startTime = microtime(true); | |
// original code: | |
$array = module_invoke($block->module, 'block_view', $block->delta); | |
$endTime = microtime(true); | |
$elapsed = $endTime - $startTime; |