Skip to content

Instantly share code, notes, and snippets.

View swenson's full-sized avatar
🍰
cupcake

Christopher Swenson swenson

🍰
cupcake
View GitHub Profile
@swenson
swenson / gist:5241278
Created March 25, 2013 22:12
givaro-3.7.1 error log
Using local scripts to install givaro-3.7.1
Found local sources at upstream/givaro-3.7.1.tar.bz2
givaro-3.7.1
====================================================
Setting up build directory for givaro-3.7.1
Finished set up
****************************************************
Host system:
Linux sagedev 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
****************************************************
In [35]: def a():
a = yield 4
print a
....:
In [36]: b = a()
In [37]: b.next()
Out[37]: 4
@swenson
swenson / test_pep8.py
Last active October 4, 2017 18:08
Test for running PEP8 against all Python files. Useful to hook up to nose and as part of your CI. I modify PEP8 in two ways by default: don't enforce 4-spacing (I prefer 2-spacing), and use 100 for the default line length, because we don't use 80-column punch cards anymore. Licensed under CC0 (public domain): do what you want. http://creativecom…
"""Run PEP8 on all Python files in this directory and subdirectories as part of the tests."""
__author__ = 'Christopher Swenson'
__email__ = 'chris@caswenson.com'
__license__ = 'CC0 http://creativecommons.org/publicdomain/zero/1.0/'
import os
import os.path
import unittest
@swenson
swenson / Make.user
Created January 3, 2014 20:38
GCE Make.user for building Julia
USE_SYSTEM_LLVM=0
USE_SYSTEM_ARPACK=1
USE_ATLAS=1
USE_BLAS64=0
USE_SYSTEM_BLAS=1
USE_SYSTEM_LAPACK=1
ATLAS_LIBDIR=/usr/lib
LIBBLAS=-L$(ATLAS_LIBDIR) -latlas
LIBLAPACK=$(LIBBLAS)
LIBBLASNAME = libatlas
@swenson
swenson / Makefile.conf
Created January 5, 2014 21:39
OpenBLAS errors on GCE
OSNAME=Linux
ARCH=x86_64
C_COMPILER=GCC
BINARY32=
BINARY64=1
CEXTRALIB=-L/usr/lib/gcc/x86_64-linux-gnu/4.7 -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../.. -lc
F_COMPILER=GFORTRAN
FC=gfortran
BU=_
FEXTRALIB=-L/usr/lib/gcc/x86_64-linux-gnu/4.7 -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../.. -lgfortran -lm -lquadmath -lm -lc
#!/bin/bash
ENDPOINT="api.sandbox.paypal.com"
CLIENT_ID=""
SECRET=""
#ENDPOINT="api.paypal.com"
#CLIENT_ID=""
#SECRET=""
@swenson
swenson / paypal.py
Created February 25, 2014 03:51
Deferred payment in Python for PayPal
import json
import requests
class PaymentInfo(object):
def __init__(self, credit_card, transaction):
self.credit_card = credit_card
self.transaction = transaction
class CreditCard(object):
def __init__(self, number, type, expire_month, expire_year, cvv2, first_name, last_name, billing_address):
from sliderepl import Deck
Deck.run()
### slide::
# Let's start by loading some stuff we're going to need.
import requests
import json
import os
from pprint import pprint
@swenson
swenson / keybase.md
Created March 29, 2014 18:16
Keybase proof

Keybase proof

I hereby claim:

  • I am swenson on github.
  • I am swenson (https://keybase.io/swenson) on keybase.
  • I have a public key whose fingerprint is 5FF9 4B3B 213C 16A0 7A08 4585 4FC1 860F 7A72 6488

To claim this, I am signing this object:

@swenson
swenson / gist:cf74cd8e282443b43b8a
Created May 21, 2014 15:51
Google Interview Study Guide
Author unknown.
1.) Algorithm Complexity: You need to know Big-O. If you struggle with
basic big-O complexity analysis, then you are almost guaranteed not to
get hired.
For more information on Algorithms you can visit:
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=alg_index
2.) Coding: You should know at least one programming language really
well, and it should preferably be C++ or Java. C# is OK too, since