✪ rqworker --db 10 default high
16:06:30 RQ worker started, version 0.3.7
16:06:30
16:06:30 *** Listening on default, high...
16:06:49 high: jobs.multiply(5, 2) (2df52ba2-bd32-4849-a8e1-c5241c78b542)
16:06:49 Job OK, result = 10
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
#!/usr/local/bin/python | |
import requests | |
import subprocess | |
# Configure Your Info Here | |
DOMAIN = "https://YOU.harvestapp.com" | |
USERNAME = "" | |
PASSWORD = "" | |
# / End Config |
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
# Description: | |
# | |
# A plugin to track points awarded for good jokes. | |
# | |
# Hubot takes transaction fees though. | |
# | |
# | |
# Dependencies: | |
# A Redis brain is recommended. | |
# |
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
# -*- coding: utf-8 -*- | |
import socket | |
import os | |
print("Connecting...") | |
if os.path.exists("/tmp/python_unix_sockets_example"): | |
client = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) | |
client.connect("/tmp/python_unix_sockets_example") | |
print("Ready.") | |
print("Ctrl-C to quit.") |
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
siblings = {1: 2, 2: 1, 3: 4, 4: 3, 5: 6, 6: 5} | |
cousins = set(siblings.keys()) | |
# Start by getting all the possible pairings for each person. | |
possible_pairings = {1: set(), 2: set(), 3: set(), 4: set(), 5: set(), 6: set()} | |
for i in cousins: | |
for j in cousins - set((i, siblings[i])): | |
possible_pairings[i].add(j) | |
combinations = [] |
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
# -*- coding: utf-8 -*- | |
BANK_FEE = 0.15 | |
COINBASE_PCT = 0.01 | |
def calculate_sale_profit(coins, price, purchase_cost): | |
value = round(coins * price, 2) | |
fee = BANK_FEE + round(value * COINBASE_PCT) | |
return (value - fee) - purchase_cost |
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
# -*- coding: utf-8 -*- | |
import sys | |
from flask import Flask, url_for | |
app = Flask(__name__) | |
@app.route("/") |
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
{ | |
"repositories": [ | |
{ | |
"type": "vcs", | |
"url": "git://github.com/jmhobbs/Swiftmailer-Transport--AWS-SES.git" | |
} | |
], | |
"require": { | |
"jmhobbs/swiftmailer-transport-aws-ses": "dev-master" | |
} |
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
<?php | |
// This is how many different "random" avatars you have. | |
$default_avatar_count = 20; | |
foreach( $comments as $comment ) { | |
// Normalize the email address so user input differences doesn't change the avatar. | |
// This is technically against RFC 2821, but in practice it is ok. | |
$normalized_email_address = trim(strtolower($comment->comment_author_email)); |
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
<!doctype html> | |
<html> | |
<head> | |
<title>GoSquared!</title> | |
</head> | |
<body> | |
<script src="jquery.min.js"></script> | |
<script> | |
jQuery(document).ready(function($) { | |
var API_KEY = 'demo', |