Skip to content

Instantly share code, notes, and snippets.

View jheath's full-sized avatar

Justin Heath jheath

View GitHub Profile
@jheath
jheath / jquery.pubsub.js
Created January 15, 2015 14:15
jquery.pubsub.js
/*
jQuery pub/sub plugin by Peter Higgins (dante@dojotoolkit.org)
Additional modifications by
Justin Heath jheath@github
and Evan Portwood evanportwood@github
- Added a processing queue and boolean to execute published events in a breadth-first manner.
This ensures that all subscribers of a given event are called before additionally triggered events are called.
- Added a clone method to the publish function to allow each subscriber to use the returned object directly without
@jheath
jheath / tail_log.sh
Created December 12, 2012 21:15
Tail nginx log file with alerts for PUT/POST
#!/bin/sh
# Tail the nginx access log
tail -100000f /var/log/nginx/access.log |\
# Ignore AWS health checks
grep --line-buffered -v '"-" 400 0 "-" "-"' |\
grep --line-buffered -v ELB-HealthChecker |\
# Add a bell char to the POST and PUT lines
@jheath
jheath / gist:3642286
Created September 5, 2012 18:39
RegEx replace with lowercased value

if you have a string like "6FA34323-C71F-4FD4-996F-002CE77E6B77"

search w/ regexp using ("[A-Z0-9-]+") replace with \L$1

\U will uppercase


Vim version:

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.