Skip to content

Instantly share code, notes, and snippets.

Avatar
🌧️

eli frozenpandaman

🌧️
View GitHub Profile
@frozenpandaman
frozenpandaman / locate.py
Created Jun 27, 2020
translate a list of IPs to a list of location coordinates
View locate.py
import geoip2.database
# https://dev.maxmind.com/geoip/geoip2/geolite2/
reader = geoip2.database.Reader('GeoLite2-City.mmdb')
locs = open("locs.txt").read().splitlines() # in - list of IPs, one per line
latlongs = [] # out
count = 1
for ip in locs:
@frozenpandaman
frozenpandaman / manga.sh
Last active Jan 8, 2020
export psds of manga pages to png (save as indexed png ->remove exif tags -> pngcrush if worth it)
View manga.sh
#!/bin/bash
dir="_png"
mkdir -p $dir # make diretory
for filename in *.psd; do # for all .psd files, save as indexed color .png, no transparency
if [[ "$filename" == *"-c"* ]]; then # grayscale unless "-c" (i.e. -credits, -color) in filename
cs="RGB"
else
cs="LinearGray"
fi
convert "$filename"[0] -colorspace $cs -colors 256 -background white -alpha remove -alpha off PNG8:$dir/"${filename%%.*}".png
@frozenpandaman
frozenpandaman / travel-recs.md
Last active Jan 12, 2021
eli's travel recommendations
View travel-recs.md

eli's travel recommendations

Last updated March 6, 2019. Top recommendations are listed first in their respective sections.

Contact: @frozenpandaman (or Facebook, if you know me).

Tokyo, Japan

Food

Restaurants in Japan often specialize in one type of food per place. Below are my favorite restaurants in the city, grouped by category, and the name of the area of Tokyo in which they're located.

@frozenpandaman
frozenpandaman / streamable_upload.py
Last active Dec 12, 2019
Upload all .mp4 files in a directory to Streamable
View streamable_upload.py
#!/usr/bin/env python
import os, requests, json
from io import BytesIO
STREAMABLE_USERNAME = ""
STREAMABLE_PASSWORD = ""
DIRECTORY = ""
def main():
View statink.py
#!/usr/bin/env python
import urllib.request, csv, datetime, pytz, prettytable, lxml
from bs4 import BeautifulSoup
def main():
statinkurl = "https://stat.ink/entire/users?_lang_=en-US"
page = urllib.request.urlopen(statinkurl).read()
bs = BeautifulSoup(page, "lxml")
table = bs.select_one("table.table-striped")
View st-imdb.py
#!/usr/bin/env python
import urllib.request, itertools, datetime, os
from bs4 import BeautifulSoup
def main():
eps = ["S1",
"https://www.imdb.com/title/tt4593118/",
"https://www.imdb.com/title/tt4593122/",
"https://www.imdb.com/title/tt4593126/",
View katakuna.py
# eli fessler, aka KUTAKi LUKUARiARiTAKUSHi
def trans(name):
d = {
'a': 'KA',
'b': 'ZU',
'c': 'Mi',
'd': 'TE',
'e': 'KU',
'f': 'LU',