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
'$' () { | |
echo "📢 [${PWD##*/}] $*" | |
eval $* | |
if [[ $? -eq 0 ]] | |
then | |
announce "Success ${PWD##*/}" | |
else | |
announce "Error ${PWD##*/}" | |
fi | |
} |
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
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 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 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 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 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 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> |
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
Example = {}; | |
Example.button = function(el) { | |
el.onclick = this.click; | |
} | |
Example.button.prototype.click = function() { | |
alert('YOU CLICK DA BUTTON'); | |
} |
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
#import "User.h" | |
@implementation User | |
@synthesize name = _name; | |
@synthesize email = _email; | |
@synthesize device_id = _device_id; | |
+ (User*) current_user { |
NewerOlder