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 ruby | |
require 'rubygems' | |
require 'open-uri' | |
require 'open3' | |
require 'json' | |
require 'sinatra' | |
require 'zlib' |
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
' | |
' http://img.motd.kr/uml/gist/:gist_id | |
' | |
' The image URL of this gist is: | |
' http://img.motd.kr/uml/gist/5317079 | |
' | |
' The source code of the web application: | |
' https://gist.github.com/trustin/5317595 | |
' |
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
$ cat ~/.local/bin/simple-httperf | |
#!/bin/bash | |
if [[ $# -ne 6 ]]; then | |
echo "Usage: $0 <num_conns> <num_reqs_per_conn> <burst_len> <host> <port> <path>" | |
exit 1 | |
fi | |
exec httperf --num-conns "$1" --num-calls "$2" --burst-length "$3" --server "$4" --port "$5" --uri "$6" --rate 10000000 |
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
/Users/[^/]+/.*(~|\.(log|tmp|bak|lock)) | |
/Users/[^/]+/\.(bash_history|scala_history|mysql_history|lesshst) | |
/Users/[^/]+/\.m2/repository/.* | |
/Users/[^/]+/\.ivy2/(cache|local)/.* | |
/Users/[^/]+/Library/Application Support/(Firefox|Thunderbird)/.* | |
/Users/[^/]+/[Ww]orkspaces?/.*/target/.* | |
/Users/[^/]+/[Ww]orkspaces?/openjdk/(sources|OBF_DROP_DIR)/.* | |
/Users/[^/]+/[Vv]irtualization/[^/]+\.vmwarevm/.* | |
/Users/[^/]+/[Ss]3/.* | |
/Users/backup/.* |
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
# 1. Put this file to /etc/pf.conf | |
# 2. Install init boot scripts using IceFloor then - http://www.hanynet.com/icefloor/ | |
# I tried to use IceFloor to configure everything but it didn't work very well. | |
# 3. Once done, you can confirm the rules were loaded with 'sudo pfctl -sr' | |
# 4. At System Preferences -> Security -> Firewall -> Firewall Options, | |
# check 'Block all incoming connections' to prevent annoying per-app dialogs. | |
set skip on lo0 | |
set block-policy drop |
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
<?xml version="1.0"?> | |
<root> | |
<appdef> | |
<appname>PATHFINDER</appname> | |
<equal>com.cocoatech.PathFinder</equal> | |
</appdef> | |
<item> | |
<name>Change Shift+Space to Command+Space</name> | |
<identifier>private.shiftspace_to_cmdspace</name> |
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
$ git config alias.merge-pullreq '!git-merge-pullreq' | |
$ git merge-pullreq 1234 | |
Fetching the pull request 1234 from netty/netty .. | |
Running: git am /tmp/pullreq.XXXXXXXX | |
Applying: ... |
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 | |
if [[ $# -lt 0 ]] || [[ $# -gt 2 ]]; then | |
echo "Usage: $0 <pull request id> [<directory>]" | |
fi | |
PULL_REQ_ID="$1" | |
if [[ "x$2" != 'x' ]]; then | |
cd "$2" || exit 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
// Before: | |
ServerBootstrap b = new ServerBootstrap(); | |
try { | |
b.eventLoop(new NioEventLoop(), new NioEventLoop()); // <-- HERE | |
... | |
} finally { b.shutdown(); } | |
// After: | |
ServerBootstrap b = new ServerBootstrap(); | |
try { |
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
// No more dynamicBuffer() - use buffer(). | |
ByteBuf buf = ByteBuf.buffer(); | |
// Increase the capacity of the buffer. | |
buf.capacity(1024); | |
... | |
// Decrease the capacity of the buffer (the last 512 bytes are deleted.) | |
buf.capacity(512); |