Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
{ | |
"author": "jaypax", | |
"email": "[email protected]", | |
"date": "26-12-2015", | |
"prefixes": [{ | |
"prefix" : "813", | |
"assigned_to" : "Smart" | |
}, | |
{ | |
"prefix": "0817", |
import sys | |
import urllib | |
import requests | |
def unshorten_url2(url): | |
r = requests.head(url, allow_redirects=True) | |
return r.url | |
def download(url): | |
full_url = unshorten_url2(url) |
# Downloads MSFTFreeEbooks as per Eric Ligman's blog | |
# https://blogs.msdn.microsoft.com/mssmallbiz/2016/07/10/how-to-download-all-of-the-free-ebooks-and-resources-in-my-free-ebooks-giveaway/ | |
# You'll probably want to do a pip install requests first before you can run the script | |
import os | |
import sys | |
import urllib | |
import requests | |
def unshorten_url2(url): | |
r = requests.head(url, allow_redirects=True) |
''' | |
A simple class to find the difference of two single level python dictionaries AND where deepdiff is just overkill | |
https://github.com/seperman/deepdiff | |
''' | |
class SimpleDictDiffer(object): | |
""" | |
Calculate the difference between two dictionaries as: | |
(1) items added | |
(2) items removed |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
find . -type f -name "*.pyc" -exec rm -v {} \; |
[core] | |
excludesfile = /Users/jaypax/.gitignore_global | |
[difftool "sourcetree"] | |
cmd = opendiff \"$LOCAL\" \"$REMOTE\" | |
path = | |
[mergetool "sourcetree"] | |
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" | |
trustExitCode = true | |
[mergetool "pycharm"] | |
cmd = charm merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$B$ |
from random import shuffle | |
def rand_pickOrder(n, caps): | |
for x in range(n): | |
shuffle(caps) | |
return caps | |
captains = ['Red', 'Astang', 'Bossing', 'MasterE'] |
#!/bin/bash | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the active virtualenv | |
# * the branch/status of the current git repository | |
# * the return value of the previous command | |
# * the fact you just came from Windows and are used to having newlines in | |
# your prompts. |
# runner.py | |
# to help debug scrapy scrapers in vscode | |
from scrapy.cmdline import execute | |
execute(['scrapy', 'crawl', 'radiall_spider', '-o', 'test.json']) | |
# same thing just with extra params | |
from scrapy.cmdline import execute | |
execute(['scrapy', 'crawl', 'coilcraft', '-o', 'test.json', '-a', 'filepath_urls=parts_urls.json']) |