I hereby claim:
- I am thefotios on github.
- I am thefotios (https://keybase.io/thefotios) on keybase.
- I have a public key whose fingerprint is 2264 2751 B5AD E6D2 DC85 FA4A 91BD C79C 39F3 48FD
To claim this, I am signing this object:
# Part 1 | |
awk 'BEGIN{ FS = ""} {for(i = 1; i <= NF; i++) if($i ~ /\(/){ floors++}else{floors--} } END { print floors}' | |
# Part 2 | |
awk 'BEGIN{ FS = ""} {for(i = 1; i <= NF; i++){ if($i ~ /\(/){ floors++}else{floors--}; if(floors < 0){print i; break}}} END { print floors}' |
#!/usr/bin/env bash | |
url=$1; | |
output=${2-output.png}; | |
size=${3-128}; | |
curl --silent -kL $url | convert - -resize ${size}x${size} $output; |
I hereby claim:
To claim this, I am signing this object:
Faraday's so convenient Ruby HTTP client library
The development of the API wrapper [RestClient gem] or I [rest_client_gem]
What you need for OAuth was using [Net / HTTP] [net_http] + [OAuth gem] the [oauth_gem]
After reading the source of the API library [Twitter gem] and [twitter_gem] [Instagram gem] such as [instagram_gem]
Thing [Faraday gem] that [faraday_gem] had been commonly used
#!/usr/bin/env ruby | |
all_user_procs = %x[/bin/ps -e -o uid,pid | /bin/egrep "^\s+[0-9]{3,4}"] | |
pids_by_user = all_user_procs.lines.inject(Hash.new{|h,k| h[k] = []}) do |h,line| | |
(uid,pid) = line.split.map(&:to_i) | |
h[uid] << pid | |
h | |
end |
#!/usr/bin/env ruby | |
all_user_procs = %x[/bin/ps -e -o uid,pid | /bin/egrep "^\s+[0-9]{3,4}"] | |
pids_by_user = all_user_procs.lines.inject(Hash.new{|h,k| h[k] = []}) do |h,line| | |
(uid,pid) = line.split.map(&:to_i) | |
h[uid] << pid | |
h | |
end |
(str, err, rc = ::OpenShift::Runtime::Utils::oo_spawn('cgsnapshot 2> /dev/null') | |
keys = %w(cpu.cfs_period_us cpu.cfs_quota_us cpuacct.usage) | |
Hash[str.scan(/^group\sopenshift\/(.*?)\s(.*?)^}/m).map{|mg| [mg[0], Hash[mg[1].scan(/\s*(#{keys.join('|')})\s*=\s*"(.*)";/).map{|k,v| [k,v.to_i]}]] }] |
{ | |
"data":[ | |
{ | |
"quickstart":{ | |
"id":"12462", | |
"href":"\/community\/content\/wordpress", | |
"name":"Wordpress", | |
"updated":"1355408736", | |
"summary":"asdf", | |
"body":"<p>asdf<\/p>", |
function! gem_gist#upload(file, private, open, description, ...) | |
if ! ( executable('gist') || executable('jist') ) | |
echoerr "This command requires gist gem. Please do `gem install gist.` or `gem install jist`" | |
return | |
endif | |
if filereadable(a:file) | |
if executable('gist') | |
let cmd = join([ | |
\ 'gist', |