Skip to content

Instantly share code, notes, and snippets.

Feature: demonstrate request overwrites temporary headers but not configure headers
Background:
* url "https://httpbin.org"
Scenario: reflect header
* configure headers = {Foo: "bar"}
Given path "/headers"
When method get
@jeffgreenca
jeffgreenca / uninstall.sh
Last active March 26, 2019 15:48
Remove application installed via "make install" that does not provide an uninstall. Warning, may not be safe / always work.
#!/bin/bash
# requires installwatch
sudo installwatch -o install_watch.log make install
# review the install_watch.log before doing the rest
grep unlink install_watch.log | cut -f 3 | sudo xargs rm
[{"Title":"Tom Clancy's The Division 2","Platform":"PC, Xbox One, PS4","Genre":"TPS","Year":"2019","Players":"8","Co-op Type":"Online","Screen View":"Full","Limited":"","Additional Notes":""},{"Title":"Anthem","Platform":"PC, Xbox One, PS4","Genre":"Action RPG","Year":"2019","Players":"4","Co-op Type":"Online","Screen View":"Full","Limited":"","Additional Notes":""},{"Title":"Crackdown 3","Platform":"PC, Xbox One","Genre":"Action-Adv.","Year":"2019","Players":"4","Co-op Type":"Online","Screen View":"Full","Limited":"","Additional Notes":""},{"Title":"Far Cry: New Dawn","Platform":"PC, Xbox One, PS4","Genre":"FPS","Year":"2019","Players":"2","Co-op Type":"Online","Screen View":"Full","Limited":"","Additional Notes":""},{"Title":"OVERKILL's The Walking Dead","Platform":"PC, Xbox One, PS4","Genre":"FPS","Year":"2019","Players":"4","Co-op Type":"Online","Screen View":"Full","Limited":"","Additional Notes":""},{"Title":"LEGO Harry Potter Collection","Platform":"Xbox One, PS4, Switch","Genre":"Action","Year":"2018"
@jeffgreenca
jeffgreenca / email-announcement-writing-guidelines.md
Last active December 10, 2018 17:36
E-mail writing guidelines, for making announcements over e-mail.

E-mail Announcement Checklist

  • First sentence is "call to action" or "critical knowledge"
  • Give a deadline for responses
  • Send a second reminder to respond, prior to the deadline
  • Tell how it impacts the recipient
  • Ask for feedback
  • Send it to (only) affected users
  • Include humor
#!/bin/sh
# from https://i3wm.org/docs/repositories.html
/usr/lib/apt/apt-helper download-file http://debian.sur5r.net/i3/pool/main/s/sur5r-keyring/sur5r-keyring_2018.01.30_all.deb keyring.deb SHA256:baa43dbbd7232ea2b5444cae238d53bebb9d34601cc000e82f11111b1889078a
dpkg -i ./keyring.deb
echo "deb http://debian.sur5r.net/i3/ $(grep '^DISTRIB_CODENAME=' /etc/lsb-release | cut -f2 -d=) universe" >> /etc/apt/sources.list.d/sur5r-i3.list
apt update && apt install i3 -y
@jeffgreenca
jeffgreenca / ploty-offline.py
Created September 10, 2018 01:03
Plotly init script for Jupyter notebooks
# Plotly init for Jupyter - https://plot.ly/python/reference/
from plotly.offline import init_notebook_mode, iplot
import plotly.graph_objs as go
init_notebook_mode(connected=True)
# Example (untested)
X = [1,2,3]
Y = [3,2,1]
trace0 = go.Scatter( x=X, y=Y )
import requests
# BAD IDEA - VERY INSECURE
from urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
r = requests.get(url, verify=False)
@jeffgreenca
jeffgreenca / import-codes-v2.py
Last active October 19, 2023 13:32
Create ArcGIS domains and codes from a CSV file
#!/usr/bin/python
# Create ArcGIS domains and codes from a CSV file
#
# Run either with this command, replacing 10.6 with your ArcGIS version:
# c:\python27\ArcGIS10.6\python.exe import-codes-v2.py
# or, for ArcGIS Pro, use this command:
# "c:\Program Files\ArcGIS\Pro\bin\Python\scripts\propy.bat" import-codes-v2.py
#
# For each unique domain identified in the csv file, a domain will be greated in the gdb workspace
# Takes as input a CSV file with exactly these headers: domain,code,code_description
@jeffgreenca
jeffgreenca / check-arcgis-env.py
Last active January 31, 2018 16:26
Validate if the arcgis python module is available
import platform
print("Using python version %s" % platform.python_version())
import arcpy
print("Everything seems OK")