Skip to content

Instantly share code, notes, and snippets.

Matt Klaber mklaber

Block or report user

Report or block mklaber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mklaber
mklaber / !README.md
Last active Dec 19, 2018
GitHub Pull Request against the current branch
View !README.md

README

GitHub helpfully prompts you to create a pull request after pushing a new branch. Unhelpfully, it always suggests PRing against master (or develop or whatever your main branch is). This Tampermonkey/ Greasemonkey script adds a "Compare & pull request (current branch)" button that will bring you to the PR creation page already comparing against the branch you're currently on.

image

How To:

  1. Install the Tampermonkey extension for Chrome or Greasemonkey extension for Firefox
View config.yaml
levels:
- form: '###$x.'
num: A
- form: '####$x.'
num: 1
- form: '#####($x)'
num: a
@mklaber
mklaber / HOWTO.md
Created Sep 23, 2015
Docker Console
View HOWTO.md

Run Civis Console Docker on a Mac

  1. Install Docker Toolbox
  2. Run Docker Quickstart Terminal (you can also use Kitematic to launch the CLI)
  3. cd to your git repository's root directory
  4. Run:
docker run -i -t --rm -e "CIVIS_API_KEY=b5b55...031" -e "DATABASE_USER=youruser" -e "DATABASE_PASSWORD=somePassword" \
-v $(pwd):/app -v /some/local/tmp/directory:/data -w /app --name some-name-that-is-useful \
View brew-ee.sh
#!/usr/bin/env bash
# Install command-line tools using Homebrew.
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@mklaber
mklaber / README.md
Created Jun 2, 2015
ScriptCreateDropIndexes_SP with spatial indexes
View README.md
@mklaber
mklaber / response.json
Created Apr 17, 2015
Stackoverflow Search Result
View response.json
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 4,
"successful": 4,
"failed": 0
},
"hits": {
"total": 1,
@mklaber
mklaber / about.md
Created Apr 6, 2015
ES Sense Error Formatter User Script
View about.md

This user script (aka greasemonkey script) adds a "Print Error" button to the upper right corner of Marvel Sense. (It's a ! with a circle around it.)

When clicked, it looks in the output pane and checks if the body of the output looks like an ES error. If it does, it'll display it in a slightly more readable form (adds pretty line breaks, etc.).

Subsequent clicks of the Print Error button will update the error message if the content in the output has changed or hide the error message if the content in the output doesn't look like an error.

Use Greasemonkey in Firefox or Tamplermonkey in Chrome to install it.

View 000-Cheat-Sheets.md

Developer Cheat Sheets

This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everyday and this Gist is the first bookmark on my list for quick and easy access.

I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer.

@mklaber
mklaber / run-sample.sql
Last active Aug 29, 2015
AWS EMR version of Esri's point-in-polygon-aggregation-hive sample
View run-sample.sql
-- This is a AWS-ified version of https://github.com/Esri/gis-tools-for-hadoop/blob/master/samples/point-in-polygon-aggregation-hive/run-sample.sql
-- expects https://github.com/Esri/gis-tools-for-hadoop/tree/master/samples/lib and https://github.com/Esri/gis-tools-for-hadoop/tree/master/samples/data to be in the root of ${INPUT}
-- s3://elasticmapreduce/libs/hive/hive-script --run-hive-script --hive-versions 0.13.1 --args -f s3://my-s3-bucket/run-sample.sql -d INPUT=s3://my-s3-bucket/path/to/samples -d OUTPUT=s3://my-s3-bucket/output/
add jar
${INPUT}/lib/esri-geometry-api.jar
You can’t perform that action at this time.