Skip to content

Instantly share code, notes, and snippets.

Andrew Turley aturley

Block or report user

Report or block aturley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ab
We have some systems at work that use the database as a queue. I've been thinking about this a bit. So have other people.
* [5 subtle ways you’re using MySQL as a queue, and why it’ll bite you](https://blog.engineyard.com/2011/5-subtle-ways-youre-using-mysql-as-a-queue-and-why-itll-bite-you)
* [A Look At Using Your Database As a Queue](http://it.toolbox.com/blogs/programming-life/a-look-at-using-your-database-as-a-queue-49143)
* [What’s the Best Way to Manage a Database Queue?](http://johnnycoder.com/blog/2007/06/20/whats-the-best-way-to-manage-a-database-queue/)
* [Looking for example design of using an SQL database as a queue for throttling web service requests of multiple users](http://dba.stackexchange.com/questions/17385/looking-for-example-design-of-using-an-sql-database-as-a-queue-for-throttling-we)
* [Using Tables as Queues](http://rusanu.com/2010/03/26/using-tables-as-queues/)
@aturley
aturley / ringmodulation.js
Created Nov 11, 2012
Ring modulation using the web audio api
View ringmodulation.js
var wac = new webkitAudioContext();
var ringGain = wac.createGainNode();
ringGain.gain.setValueAtTime(0, 0);
var ringCarrier = wac.createOscillator();
ringCarrier.type = ringCarrier.SINE;
ringCarrier.frequency.setValueAtTime(2500, 0);
var url = "Ring_Modulation-Original_sample.ogg";
@aturley
aturley / links.md
Created Aug 9, 2012
4 part series about writing a url shortening service in erlang (using webmachine)
View links.md
@aturley
aturley / sig.bf
Created Aug 1, 2012
This was my email sig for a while. It's a Befunge program that generates a Serpinski triangle.
View sig.bf
>84*>:#v_55+"ude.ub@yelruta">:#,_@>188*+>\02p\12p\:22p#v_$ 55+,1- v
^ 0 v +1\ _^#-+*< >22g02g*"_@"*-!1- #v_v>
>:>::3g: ,\188 ^^ -1\g21\g22<p3\"_":<
________________________________@_________________________________^ p3\"@":<
@aturley
aturley / README.md
Created Jul 19, 2012
irssi to pubnub to web page for remote IRC message notification. Remember to set the keys in the scripts. The soundcloud player API wrapper is from https://github.com/soundcloud/Widget-JS-API/blob/master/soundcloud.player.api.js .
View README.md

To use this, just:

  • Modify the source to use your keys.
  • Put pnnotify.pl in your .irrsi/script directory and run "/script load pnnotify.pl" in irssi.
  • Put the .html and .js files in a directory and server the up in a web server.
  • Open up http://yourserverhere/notify.html in a browser.

Now, whenever you get a message in IRC, you'll know.

@aturley
aturley / minpylint.py
Created Jun 27, 2012
Minimum python file that gets a 10/10 from pylint
@aturley
aturley / ga_invite.rb
Created Jun 20, 2012
GA code snipped
View ga_invite.rb
if know_code = true
print "forward this email to 5 friends."
else
print "teach me how to code!"
end
@aturley
aturley / git-codecheck
Created Jun 20, 2012
Run pep8 and pylint on all of the new and modified Python files in a git repo.
View git-codecheck
#!/bin/bash
if [ -z "$(which pep8)" ];
then
echo "Could not find pep8"
exit 1
fi
if [ -z "$(which pylint)" ];
then
@aturley
aturley / gist:2955828
Created Jun 19, 2012
regex vs split and test in Python
View gist:2955828
aturley@silverslab [~/play]$ cat regex_vs_split.py
import time
import re
url = "http://octopart.com/api/v2/parts/match?manufacturer_name=texas+instruments&mpn=SN74LS240N&suppress_status_codes=True"
url_x = "http://octopart.com/api/v2/parts/match?manufacturer_name=texas+instruments&mpn=SN74LS240N"
url_l = "http://octopart.com/api/v2/parts/match?manufacturer_name=texas+instruments&mpn=SN74LS240N&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&junk=1&
You can’t perform that action at this time.