Skip to content

Instantly share code, notes, and snippets.

{
"description": "CAT schemas for Industry Member reportable events",
"version": "4.0.0",
"dataTypes": [
{
"dataType": "Price",
"JSONDataType": "NUMBER",
"precision": 10,
"scale": 8
},

Keybase proof

I hereby claim:

  • I am patricklucas on github.
  • I am plucas (https://keybase.io/plucas) on keybase.
  • I have a public key ASAAf5af_PRPc0SYFSQwh5Bm1ocuIRUztRPfRmVZQvO0uAo

To claim this, I am signing this object:

@patricklucas
patricklucas / count_words.py
Last active August 29, 2015 14:07
Introducing Pyleus: An Open-source Framework for Building Storm Topologies in Pure Python
from collections import defaultdict
from pyleus.storm import SimpleBolt
class CountWordsBolt(SimpleBolt):
def initialize(self):
self.words = defaultdict(int)
@patricklucas
patricklucas / pypy_experiment.py
Last active December 14, 2015 05:18
Demonstration of CPython vs PyPy performance on a simple task. From the docstring: "This demonstrates that the expectation of the number of random values on the interval 0 <= r < 1 which sum to greater than 1 is the constant 'e'."
from __future__ import division
import random
def experiment(num_trials):
"""This demonstrates that the expectation of the number of random values
on the interval 0 <= r < 1 which sum to greater than 1 is the constant 'e'.
"""
total_num_values = 0
@patricklucas
patricklucas / Makefile
Last active December 11, 2015 11:39
Basic SDL thingy
CFLAGS=`sdl-config --cflags`
LIBS=`sdl-config --libs` -lSDL_image -lSDL_gfx
.PHONY: all
all: fun
fun: main.cpp
g++ -o $@ $(CFLAGS) $(LIBS) $^
@patricklucas
patricklucas / google_whois.txt
Created January 16, 2013 22:43
What you see when you whois google.com
$ whois google.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
GOOGLE.COM.ZZZZZZZZZZZZZZZZZZZZZZZZZZZ.LOVE.AND.TOLERANCE.THE-WONDERBOLTS.COM
GOOGLE.COM.ZZZZZZZZZZZZZZZZZZZZZZZZZZ.HAVENDATA.COM
@patricklucas
patricklucas / ssh_host_completion.sh
Created January 10, 2013 22:27
Bash autocompletion for SSH config hosts.
function _ssh_completion() {
perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config
}
complete -W "$(_ssh_completion)" ssh
@patricklucas
patricklucas / virtualenv_completion.sh
Created December 16, 2012 07:13
Bash autocompletion for Python virtualenvs.
# bash completion for Python virtualenvs
VE_DIR="$HOME/dev/virt"
function ve() {
if [ -z "$1" ]; then
echo "Must specify env" 2>&1
return 1
fi
@patricklucas
patricklucas / hlhl.py
Created September 6, 2012 16:23
Half-Life "Half Life" Calculator
"""Functions for calculating when the game Half-Life has been out for exactly
half of someone's life.
"""
import datetime
release_date = datetime.date(1998, 11, 19)
def for_birthdate(birth_date):
"""Given a person's date of birth, return the date on which Half-Life has
been out for half of their life.
CC=g++
CPPFLAGS=-O2 -Wall -Wextra -Werror -std=c++11
PROJ=homework2
BIN=$(PROJ)
SRCS=main.cpp vector3d.cpp
OBJS=$(subst .cpp,.o,$(SRCS))
$(BIN): $(OBJS)
$(CC) -o $@ $^