Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gjlondon on github.
  • I am gjlondon (https://keybase.io/gjlondon) on keybase.
  • I have a public key ASDDXW-uyDsm2EVMOmAK14gVSQiTIVdfnOqYGVmojAseBAo

To claim this, I am signing this object:

@gjlondon
gjlondon / sfpdmg_coc.md
Created August 6, 2019 23:00
San Francisco PyData Meetup Group Code of Conduct

PyData Meetup Code of Conduct

San Francisco PyData Meetup Group Diversity Statement The San Francisco PyData Meetup Group (hereafter SFPDMG) welcomes and encourages participation in our community by people of all backgrounds and identities. We are committed to promoting and sustaining a culture that values mutual respect, tolerance, and learning, and we work together as a community to help each other live out these values. We have created this diversity statement because we believe that a diverse community is stronger, more vibrant, and produces better software and better science. A diverse community where people treat each other with respect has more potential contributors, more sources for ideas, and fewer shared assumptions that might hinder development or research. Although we have phrased the formal diversity statement generically to make it all-inclusive, we recognize that there are specific identities that are impacted by systemic discrimination and marginalization. We welcome all people to participat

Keybase proof

I hereby claim:

  • I am gjlondon on github.
  • I am gjlondon (https://keybase.io/gjlondon) on keybase.
  • I have a public key ASDDXW-uyDsm2EVMOmAK14gVSQiTIVdfnOqYGVmojAseBAo

To claim this, I am signing this object:

@gjlondon
gjlondon / nbdiff_with_jq.sh
Created November 3, 2018 21:37
Recipe for stripping outputs before using nbdime to compare Jupyter notebooks
alias nbstrip_jq="jq --indent 1 \
'(.cells[] | select(has(\"outputs\")) | .outputs) = [] \
| (.cells[] | select(has(\"execution_count\")) | .execution_count) = null \
| .metadata = {\"language_info\": {\"name\": \"python\", \"pygments_lexer\": \"ipython3\"}} \
| .cells[].metadata = {} \
'"
nbdime diff-web <(nbstrip_jq <1st notebook>) <(nbstrip_jq <2nd notebook>)
# most of the time, don't use dots at all:
from spam import eggs
# If Python has trouble finding spam and spam.py is in the same directory:
# (i.e. "package" as the code doing the import):
from .spam import eggs
# when spam.py is in the *enclosing* package, i.e. one level up:
from ..spam import eggs
# ImportError! At least in Python 3, you can only use the dots with
# the `from a import b` syntax:
@gjlondon
gjlondon / reproduction.ipynb
Last active April 20, 2017 19:37
reproduction of apparent bug with .label() and not_() in SQLAlchemy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gjlondon
gjlondon / .playground
Created August 29, 2015 21:20
Confusion on Swift protocols and types
// example of confusion with swift protocols and classes
protocol Bar {
var m: Int { get set }
}
class Foo:Bar {
var m: Int
required init(m: Int) {
@gjlondon
gjlondon / asana_dump.py
Created January 4, 2014 18:32
Export Asana tasks to CSV
# use Asana's "export project to JSON" function and copy-paste contents to an "asana_dump.js" file
import json
import csv
import pprint
pp = pprint.PrettyPrinter(indent=4)
f = json.load(open("asana_dump.js"))
with open('asana_dump.csv', 'w') as fp:

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@gjlondon
gjlondon / gist:5218731
Created March 22, 2013 03:28
DEBUG output following crash of my vagrant VM
VAGRANT_LOG=DEBUG vagrant ssh ~/programming/tools/vagrant_boxes/linernotes_dev 6 ↵
INFO global: Vagrant version: 1.0.4
INFO vagrant: `vagrant` invoked: ["ssh"]
DEBUG vagrant: Creating Vagrant environment
INFO environment: Environment initialized (#<Vagrant::Environment:0x000001028b7150>)
INFO environment: - cwd: /Users/rogueleaderr/programming/tools/vagrant_boxes/linernotes_dev
INFO environment: Home path: /Users/rogueleaderr/.vagrant.d
INFO plugin: Searching and loading any available plugins...
INFO plugin: Loaded 0 plugins.
DEBUG vagrant: Loading environment