Skip to content

Instantly share code, notes, and snippets.

@esprengle
esprengle / filedownloader.py
Created June 30, 2019 03:21 — forked from bitoffdev/filedownloader.py
filedownloader.py
# Python file downloader for Pythonista by OMZ Software
# By: EJM Software ---- http://ejm.cloudvent.net
# Source: https://gist.github.com/89edf288a15fde45682a
# *****************************************
# This simple script uses the requests module to download files
# and the ui module to show a progress bar
# You can use this bookmarklet to download files from Safari:
# javascript:window.location='pythonista://filedownloader?action=run&argv='+encodeURIComponent(document.location.href);
import ui, console, clipboard, sys, requests, zipfile
@esprengle
esprengle / Material Theme.itermcolors
Created August 11, 2019 18:15 — forked from Revod/Material Theme.itermcolors
Material Theme For iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.25882352941176473</real>
@esprengle
esprengle / Quiver_HTML_importer.py
Created October 10, 2019 23:23 — forked from kspeeckaert/Quiver_HTML_importer.py
Quiver HTML importer
import json
import uuid
from pathlib import Path
from urllib.parse import urlparse
from datetime import datetime
import html2text
import requests
from bs4 import BeautifulSoup
@esprengle
esprengle / markdown to quiver.py
Created October 11, 2019 02:22 — forked from bllchmbrs/markdown to quiver.py
Convert Markdown Files to Quiver notes
import argparse
import json
import re
import os
from time import time
parser = argparse.ArgumentParser(description='Convert to Quiver Format')
parser.add_argument("src", help="The Source File You want to Convert")
args = parser.parse_args()
cells = []
@esprengle
esprengle / user_agents.txt
Created December 31, 2019 03:38
List of almost 900 User-Agent strings
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)
Mozilla/4.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)
Mozilla/1.22 (compatible; MSIE 10.0; Windows 3.1)
Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))
Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7)
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7
@esprengle
esprengle / google_domains.txt
Created December 31, 2019 03:39
List of main google domains
www.google.com
www.google.ad
www.google.ae
www.google.com.af
www.google.com.ag
www.google.com.ai
www.google.al
www.google.am
www.google.co.ao
www.google.com.ar
# magic_google.py
# Source: https://github.com/howie6879/magic_google/blob/master/examples/google_search.py
#
# Example usage of magic-google python package
import os
import sys
import time
import random
import pprint
def quickpath(fp: str) -> Path:
"""Make a pathlib.Path obj quickly from a str only if it exists"""
if fp.startswith("~"):
p = Path(fp).expanduser()
else:
p = Path(fp).absolute()
if not p.exists():
print(f"File object '{p_posix := p.as_posix()}' does not exist!")
print(f"Create '{p_posix}' with <Path>.mkdir() or <Path>.touch()")
return p
@esprengle
esprengle / concat_images.py
Created February 14, 2020 04:03 — forked from njanakiev/concat_images.py
Concat images in a matrix grid with Python and PIL
import os
import random
from PIL import Image, ImageOps
def concat_images(image_paths, size, shape=None):
# Open images and resize them
width, height = size
images = map(Image.open, image_paths)
images = [ImageOps.fit(image, size, Image.ANTIALIAS)
@esprengle
esprengle / install_ipython.py
Created March 27, 2020 04:02 — forked from ColdGrub1384/install_ipython.py
A script for installing IPython on Pyto (11.1.12+)
"""
Installs IPython on Pyto.
Usage: Usage: import requests as r; exec(r.get('https://bit.ly/35iSbM1').content.decode())
"""
from pip import main as pip
import os.path
docs = os.path.expanduser("~/Documents")