This file contains hidden or 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
'$' () { | |
echo "📢 [${PWD##*/}] $*" | |
eval $* | |
if [[ $? -eq 0 ]] | |
then | |
announce "Success ${PWD##*/}" | |
else | |
announce "Error ${PWD##*/}" | |
fi | |
} |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"net/http/cookiejar" | |
"net/url" | |
"os" | |
"time" |
This file contains hidden or 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
# remap prefix to Control + a | |
unbind C-b | |
set -g prefix C-a | |
# bind C-a send-prefix | |
bind-key a send-prefix | |
# force a reload of the config file | |
unbind r | |
bind r source-file ~/.tmux.conf \; display "Reloaded!" |
This file contains hidden or 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
class Hash | |
def to_url_params | |
elements = [] | |
self.each_pair do |key, value| | |
elements << param_for(key, value).flatten | |
end | |
elements.join('&') | |
end | |
private |
This file contains hidden or 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
irb(main):021:0> m | |
=> "message" | |
irb(main):022:0> m.byteslice(0) | |
=> "s" | |
irb(main):023:0> "message".byteslice(0) | |
=> "m" |
This file contains hidden or 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
function announce { | |
say $1 && ~/bin/terminal-notifier.app/Contents/MacOS/terminal-notifier -message $1 -title $1 | |
} | |
function @ { | |
./bin/$1 $2 $3 $4 $5 | |
} | |
function $ { | |
eval $* |
This file contains hidden or 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
require 'json' | |
require 'cgi' | |
@host = 'http://localhost:55672' | |
@user = 'guest' | |
@pass = 'guest' | |
@queues = JSON.parse(`curl -u #{@user}:#{@pass} #{@host}/api/queues`) | |
@commands = @queues.map { |q| %Q{curl -i -u #{@user}:#{@pass} -H "content-type:application/json" -XDELETE #{@host}/api/queues/#{CGI::escape(q['vhost'])}/#{q['name']}} } |
This file contains hidden or 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
require 'goliath' | |
require 'em-synchrony/em-http' | |
class UploadProxy < Goliath::API | |
def on_headers(env, headers) | |
env.logger.info 'received headers: ' + headers.inspect | |
env['async-headers'] = headers | |
end |
This file contains hidden or 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
<button actlike='Example.button'>Click Me!</button> |
NewerOlder