Skip to content

Instantly share code, notes, and snippets.

View Bachmann1234's full-sized avatar

Matt Bachmann Bachmann1234

View GitHub Profile
### Keybase proof
I hereby claim:
* I am bachmann1234 on github.
* I am bachmann (https://keybase.io/bachmann) on keybase.
* I have a public key whose fingerprint is 72F8 418B AAFB B133 F1B5 123C 760F 15C5 2479 A73C
To claim this, I am signing this object:
{
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/books": {
"description": "Manage your books"
}
}
}
},
@Bachmann1234
Bachmann1234 / gist:a2b4207caa29dbc23e29
Created May 20, 2014 04:26
Books api sample response
{
"kind": "books#volumes",
"totalItems": 1233,
"items": [
{
"kind": "books#volume",
"id": "lrf4xxsgmd8C",
"etag": "If0gLY4bxoY",
"selfLink": "https://content.googleapis.com/books/v1/volumes/lrf4xxsgmd8C",
"volumeInfo": {
<?xml version="1.0" ?>
<!DOCTYPE coverage
SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-03.dtd'>
<coverage branch-rate="0" line-rate="1" timestamp="1404088604881" version="3.7.1">
<!-- Generated by coverage.py: http://nedbatchelder.com/code/coverage -->
<packages>
<package branch-rate="0" complexity="0" line-rate="1" name="">
<classes>
<class branch-rate="0" complexity="0" filename="test.py" line-rate="1" name="test">
<methods/>
@Bachmann1234
Bachmann1234 / gist:cd8e692b9435492b669f
Created October 23, 2014 17:47
this.py (from the python source)
s = """Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
@Bachmann1234
Bachmann1234 / Output
Last active August 29, 2015 14:09
Functools example. Create a basetwo function
[18, 91, 15]
@Bachmann1234
Bachmann1234 / summarize.py
Last active August 29, 2015 14:10
Summarize articles
#!/usr/bin/env python
from __future__ import unicode_literals, print_function
import os
import urllib
import urllib2
import sys
import re
import json
TITLE = "title"
@Bachmann1234
Bachmann1234 / summarize3.py
Last active August 29, 2015 14:11
Summarize Python3
#!/usr/bin/env python3
import os
import urllib
import urllib.request
import sys
import re
import json
TITLE = "title"
@Bachmann1234
Bachmann1234 / Post.py
Last active August 29, 2015 14:11
PostToPR
from github import Github
token = '<Token>'
pr_number = 1126
g = Github(token)
repo = g.get_repo('<Repo>')
pr = repo.get_pull(pr_number)
with open('diff-cover.txt') as f:
pr.create_issue_comment(f.read())
@Bachmann1234
Bachmann1234 / Test.java
Created December 18, 2014 20:03
Statically initialized map
import java.util.HashMap;
import java.util.Map;
public class Test {
public static void main(String[] args) {
Map<Integer, String> tens = new HashMap<Integer, String>(){{
put(10, "ten");
put(20, "twenty");
put(30, "thirty");
put(40, "fourty");
put(50, "fifty");