This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
usage: | |
session_staff [<url>] | |
session_staff --report [<kind>] [<url>] | |
session_staff --version | |
session_staff --debug | |
options: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# NOTE: keeping this gist for 3.6.0 release, because I want to keep 3.5 around for a bit too; | |
# Here is how I built Python v3.6.0b1...onward | |
# on OS/X, where brew is installed | |
# (and python2.7 and python3.5 installed by brew): | |
# make sure you have openssl installed (this is for installing pip) | |
# and a recent tcl-tk, if you're going to use idle | |
# (see https://www.python.org/download/mac/tcltk/ for more info) | |
# If you have them installed, you might want to `brew upgrade` them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script, when used with Google Apps Scripts will delete 500 emails - the amount the API will return with one call. | |
# It can be triggered to run periodically (I set @ 5 minute, since it runs slow) without user interaction | |
# enabling you to bulk delete email in Gmail without getting the #793 errors, etc., from Gmail. | |
# Configure the search query in the code below to match the type of emails you want to delete | |
# See - https://developers.google.com/apps-script/reference/gmail/gmail-app#search(String) | |
# and https://support.google.com/mail/answer/7190?hl=en | |
# Browser to https://script.google.com/. | |
# Start a script and paste in the code below. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from os import path | |
import sys | |
import json | |
import yaml | |
if len(sys.argv) > 1: | |
print("usage:\n\t{} < your_json_file > your_yaml_file".format( | |
path.basename(sys.argv[0]))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
# 2017-05-30 17:02:10.049243 | |
url = 'https://twitter.com/MinaMarkham/status/865606994614296576' | |
r = requests.get(url) | |
# Save the text, see if response is there or not manually: | |
# 2017-05-30 17:04:07.293014 | |
with open('bug_reqraw.txt', 'w') as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is for ipython interactive | |
# - you can, for example, place this in | |
# ~/.ipython/profile_default/startup | |
def breakpoint_(condition=True): | |
''' | |
in ipython: | |
- breakpoint_() <= break always | |
- breakpoint_(False) <= never break | |
- breakpoint_(condition) <= break if True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
from sys import stdin | |
from os import path | |
excl_f = path.expanduser("~/.config/pipupgrade/exclude") | |
with open(excl_f, "r") as f: | |
excl = [] | |
for line in f: | |
excl.append(line[:-1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
# doing little more than applying my suggestions to the | |
# first-time coding effort of: | |
# https://www.reddit.com/r/Python/comments/6rvd0v/first_time_properly_getting_into_coding_how_is/ | |
# There is more which can be done / said here (e.g. EOF-quit handling), but this | |
# shows the suggestions I put forth applied, and the effect of separating getting input | |
# from forming the calculation. |
These are my notes on Ubuntu 16.04. It seems generic enough, that I trust it applies to any Linux (perhaps any gcc) build.
I (lazily) had used https://vim.spf13.com vim plugins.
The startup error messages were getting annoying, in
particular from neocomplete (which needs Lua support). I also had
problems from python-mode, but this was unrelated (I ended up removing,
then re-installing python-mode, via the :Plugin
plugin).
This excursion was triggered by a