Skip to content

Instantly share code, notes, and snippets.

View jrmontag's full-sized avatar

Josh Montague jrmontag

View GitHub Profile
@jrmontag
jrmontag / create_geojson.py
Last active March 4, 2024 02:48
shotspotter geojson (building on https://github.com/kevee/shotspotter-locations ) - map sometimes takes some refreshes
import json
import logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s",
)
def main(input_file, output_file) -> None:
  • multi cursor (or multi-line select) ref
    • option + shift
  • type tooltip for variable under cursor
    • control + shift + p
  • search in everything (classes, files, symbols, etc)
    • double-tap shift
  • comment highlighted block of code
    • command + /
  • jump to definition / usage
  • command + b
@jrmontag
jrmontag / mbp-setup.bash
Created June 30, 2017 17:18
mbp setup (WIP)
#!/usr/bin/env bash
# written by jmontague
# last edit: 2017-03
echo
echo "****************"
echo "*** installing system applications ***"
echo "****************"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrmontag
jrmontag / gist:83e1083ba7ce43ea1dba
Last active October 1, 2015 19:43
Common (GH-flavored) markdown formatting

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

@jrmontag
jrmontag / PyDataSEA.md
Last active August 29, 2015 14:25
Plans for PyData Seattle (2015)

PyData Seattle, 2015

These are my (@jrmontag) ongoing plans for attendence at PyData (website, full schedule). I'll likely continue to edit this throughout the week (and event)*. If you spot me, come say hi!

* the schedule is also still shifting

2015-07-24 (Tutorials)

Time | Title | Room

@jrmontag
jrmontag / README.md
Last active August 29, 2015 14:04
Built a new virtualenv from scratch (brewed Python 2.7.7) with this list. Results in 48 packages in ``pip list``

Build fresh Pydata stack

  • last updated: 2015-02-27

requirements.txt files for setting up a new data project stack for Python. First, install virutalenv and virtualenvwrapper, then build new Python virtualenv for data projects.

From a fresh OS X install with homebrew installed:

$ brew intall python

$ brew install python3 # optional

@jrmontag
jrmontag / gist:9980ee3f79154ec81bff
Created June 13, 2014 23:58
Example of gnacs.py geojson output with Foursquare data as input
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrmontag
jrmontag / gist:957b4bb8f4b89d5006a8
Last active September 21, 2022 12:07
split a string at every nth occurrence of a delimiter (here, a pipe) in Python
import re
s = 'id|tag1|id|tag2|id|tag3|id|tag4'
# nb: escaping | (delimiter) necessary *outside* of character set ( [] ), not inside
print re.findall("[^|]+\|[^|]+", s)
# ['id|tag1', 'id|tag2', 'id|tag3', 'id|tag4']
n=3
@jrmontag
jrmontag / PyCon-2014.md
Created April 9, 2014 01:58
PyCon 2014 plans