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
# A quickie raffle script that uses random.org to choose winning entries. | |
import urllib2 | |
winners = 1 | |
entries = [ | |
"foo", | |
"bar", | |
"baz", |
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
Using a quick hack to follow the chain of links from this tweet: https://twitter.com/MoldyMagnet/status/557259478215577600 | |
@MoldyMagnet 2015-01-19 19:33:07 -- Have we learned nothing? This is the kind of world we are living in: https://t.co/Mfwi7AUbpm | |
@asuter 2015-01-19 04:19:56 -- The sort of blinkard philistine pig-ignorance I've come to expect from non-creative garbage. https://t.co/GMkAa81DQO | |
@doctroid 2015-01-19 04:02:47 -- I blame Matt McIrvin. https://t.co/8zdFGrNX90 | |
@sciencecomic 2015-01-19 03:12:41 -- Utter tripe. Irreconcilable. https://t.co/sroTUQHGTg | |
@arthur_affect 2015-01-19 03:09:50 -- Why do I let myself get dragged into this nonsense https://t.co/3HKAhXfAUi | |
@GlennF 2015-01-19 01:47:31 -- This has gone on far too long. https://t.co/JCb5CeOqhr | |
@margarita 2015-01-19 01:46:24 -- Speechless. https://t.co/Er7YgnbhqB | |
@alexmassie 2015-01-18 22:01:06 -- Shameful but not, alas, surprising. https://t.co/9fVJUZ02sv |
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
interval = 60 * 5 | |
import time, os | |
while (True): | |
cmd = "/usr/sbin/screencapture -C -t jpg -x %f.jpg" % time.time() | |
print cmd | |
os.system(cmd) | |
time.sleep(interval) |
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
### Keybase proof | |
I hereby claim: | |
* I am jmk on github. | |
* I am jmk (https://keybase.io/jmk) on keybase. | |
* I have a public key whose fingerprint is E137 799D 0FCC 4F75 16D1 069B D521 7721 4757 75C0 | |
To claim this, I am signing this object: |
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
# This script sets Google Talk (Jabber/XMPP) SRV records for DigitalOcean | |
# domains. | |
# | |
# To verify that your records are correct, you can query your domain's records | |
# like so: | |
# | |
# dig +short srv _xmpp-server._tcp.yourdomain.com | |
# | |
# (If your WHOIS information does not yet point to DigitalOcean's DNS servers, | |
# you need to add @ns1.digitalocean.com to the arguments to dig.) |
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 csv | |
import sys | |
from collections import namedtuple | |
rows = csv.reader(sys.stdin) | |
fields = [field.strip().lower().replace(' ', '_').replace('/', '_') | |
for field in rows.next() if field.strip() != ''] | |
PaypalRecord = namedtuple('PaypalRecord', fields) |
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
#dsq-global-toolbar | |
.dsq-clearfix { | |
display: none; | |
} | |
#dsq-comments-title h3 { | |
} | |
#disqus_thread { | |
width: 730px !important; |
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
#include <QApplication> | |
#include <QItemDelegate> | |
#include <QMenu> | |
#include <QMouseEvent> | |
#include <QTreeWidget> | |
#include <QTreeWidgetItem> | |
// Qt documentation states that user types should begin at this value. | |
static const int ItemType1 = QTreeWidgetItem::UserType; | |
static const int ItemType2 = QTreeWidgetItem::UserType + 1; |
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
#include "main.h" | |
int main(int argc, char** argv) | |
{ | |
QApplication app(argc, argv); | |
MyTreeWidget w; | |
w.show(); |
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
#include "SDL.h" | |
#include <stdlib.h> | |
#include <math.h> | |
struct Rect | |
{ | |
Rect() : x0(0), y0(0), x1(0), y1(0) {} | |
Rect(double a0, double b0, double a1, double b1) : | |
x0(a0), y0(b0), x1(a1), y1(b1) {} |