Skip to content

Instantly share code, notes, and snippets.

@bvanvugt
bvanvugt / smtp-restbin.md
Last active March 17, 2016 16:50
smtp-restbin.md

SMTP REST API

You will be creating a web service capable of...

  • receiving emails over SMTP and storing contents
  • fetching email contents over HTTP REST API
  • viewing email contents in a browser

Overview

@bvanvugt
bvanvugt / bounty.md
Last active March 25, 2016 06:48
Bounty Snake README

Bounty Snakes (REMOTE)

BattleSnake sponsors wanted to get more involved this year, so we've introduced Bounty Snakes.

Bounty Snakes are snakes programmed by sponsors in advance of the tournament. Each Bounty Snake will have a bounty prize attached to it, along with specific criteria for defeating it. The first team to successfully defeat a Bounty Snake throughout the day will claim its bounty prize.

Bounty Snakes will not go down easy, and we suggest not spending time focused on defeating Bounty Snakes.

Available Bounty Snakes and their rewards will are listed below. Some Bounty Snakes may not appear until the day of the event.

import sqlite3
class CohortDatabase(object):
def __init__(self):
self.db = sqlite3.connect(':memory:')
# Create Tables
self.db.cursor().execute("""
### Keybase proof
I hereby claim:
* I am bvanvugt on github.
* I am bvanvugt (https://keybase.io/bvanvugt) on keybase.
* I have a public key whose fingerprint is 0BF2 4AB6 B045 FF31 4727 C156 4DE4 0D34 C74D D045
To claim this, I am signing this object:
@bvanvugt
bvanvugt / email.html
Created December 12, 2014 18:43
"Plain Text" HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Email Title</title>
</head>
<body>
@bvanvugt
bvanvugt / redis_task_monitoring.py
Last active August 29, 2015 14:06
Simple Task Monitoring in Redis
# See http://blog.sendwithus.com/task-monitoring-using-redis/ for details and documentation.
def start_task(task_type):
redis.HINCRBY('ACTIVE_TASKS', task_type, 1)
def stop_task(task_type):
with redis.MULTI:
redis.HSET('IDLE_SINCE', task_type, now())
redis.HINCRBY('ACTIVE_TASKS', task_type, -1)

Template:

<html>
    <head>
        {% snippet common_style %}
    </head>
    <body>
        {% snippet common_header %}