I hereby claim:
- I am mrinalwadhwa on github.
- I am mrinalwadhwa (https://keybase.io/mrinalwadhwa) on keybase.
- I have a public key ASCPMxSM9YAbqvODLF8K_n54VAt7bdiQJGlCyriSdn0tQAo
To claim this, I am signing this object:
-module(pad_binary). | |
% http://erlang.org/pipermail/erlang-questions/2008-December/040709.html | |
-spec pad_binary_to(WidthInBytes :: pos_integer(), Raw :: binary()) -> | |
Padded :: binary(). | |
pad_binary_to(WidthInBytes, Raw) -> | |
case (WidthInBytes - size(Raw) rem WidthInBytes) rem WidthInBytes of | |
0 -> Raw; | |
N -> <<Raw/binary, 0:(N*8)>> | |
end. |
def configure_caching(config) | |
if Vagrant.has_plugin?('vagrant-cachier') | |
config.cache.scope = :box | |
config.cache.enable :generic, { :cache_dir => "/var/downloads/cache" } | |
end | |
end | |
Vagrant.configure('2') do |config| |
#!/usr/bin/env bash | |
# | |
# Usage: | |
# download.sh URL DEST MD5 | |
# | |
# Example: | |
# download.sh \ | |
# http://a.mbbsindia.com/hbase/1.1.3/hbase-1.1.3-bin.tar.gz \ | |
# /var/downloads/cache/1c9f52d89cf665ef35f101cb8f2b57e4 \ | |
# 1c9f52d89cf665ef35f101cb8f2b57e4 |
function prompt_color(){ | |
case $# in | |
3) echo -en "\[\033[$2\]\[\033[$3\]\[$1\033[0m\]";; | |
2) echo -en "\[\033[$2\]$1\[\033[0m\]";; | |
1) echo -en "$1";; | |
*) echo -en "";; | |
esac | |
} | |
function git_branch(){ |
#!/usr/bin/env bash | |
## | |
## Usage: random-string [length] [lines] [pattern] | |
## Generates a random string using /dev/urandom | |
## | |
## Default: | |
## length: 32 | |
## lines: 1 | |
## pattern: 'a-zA-Z0-9' | |
## |
#!/usr/bin/env bash | |
sudo lsof -i -P | grep -i "listen" | |
# REFERENCES | |
# http://apple.stackexchange.com/a/117648 |
require 'base64' | |
# tools.ietf.org/html/rfc2397 | |
# developer.mozilla.org/en/data_URIs | |
# "data:" + MIME type + ";base64," + base64-encoded content | |
def to_data_url(content, content_type) | |
outuri = 'data:' + content_type + ';base64' | |
content = Base64.encode64(content).gsub("\n", '') | |
outuri += ",#{content}" |
I hereby claim:
To claim this, I am signing this object:
/* based on http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified/ */ | |
.cf:before, | |
.cf:after { | |
content: "."; | |
display: block; | |
height: 0; | |
overflow: hidden; | |
} | |
.cf:after {clear: both;} |
#!/usr/bin/env bash | |
## | |
## Usage: afk | |
## Lock Screen on MacOS | |
## | |
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend |