Skip to content

Instantly share code, notes, and snippets.

View killertilapia's full-sized avatar
Converting coffee to code

Jaypax Ginete killertilapia

Converting coffee to code
View GitHub Profile
@killertilapia
killertilapia / runner.py
Created July 15, 2019 05:46
To help debug scrapy scrapers in vscode
# 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'])
@killertilapia
killertilapia / .bash_prompt
Last active April 10, 2017 06:34
Bash script for customising your bash prompt
#!/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.
@killertilapia
killertilapia / rand_pickOrder.py
Created March 24, 2017 00:45
Random pick order for Captains Dota2 Innovuze
from random import shuffle
def rand_pickOrder(n, caps):
for x in range(n):
shuffle(caps)
return caps
captains = ['Red', 'Astang', 'Bossing', 'MasterE']
@killertilapia
killertilapia / .gitconfig
Created March 10, 2017 06:45
Git config for with merge and diff tools (pycharm) configured
[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$
@killertilapia
killertilapia / pyc-remover.sh
Created December 19, 2016 08:14
Bash command to remove old or stale *.pyc files in project directory
find . -type f -name "*.pyc" -exec rm -v {} \;
@killertilapia
killertilapia / README.md
Created December 6, 2016 08:21 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@killertilapia
killertilapia / SimpleDictDiffer.py
Last active October 27, 2016 05:52
A simple class to find the difference of two single level python dictionaries
'''
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
@killertilapia
killertilapia / MSFTFreeEbooksDownloader.py
Last active July 14, 2016 07:38
Downloads MSFTFreeEbooks as per Eric Ligman's blog
# 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)
@killertilapia
killertilapia / MSFTFreeEbooksDownload.py
Created July 14, 2016 07:05
Downloads MSFTFreeEbooks as Eric Ligman
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)
@killertilapia
killertilapia / mobile_prefixes.json
Created December 26, 2015 03:11
Mobile Prefixes JSON
{
"author": "jaypax",
"email": "killer.tilapia@gmail.com",
"date": "26-12-2015",
"prefixes": [{
"prefix" : "813",
"assigned_to" : "Smart"
},
{
"prefix": "0817",