Skip to content

Instantly share code, notes, and snippets.

@wlerin
wlerin / ss_mod_author_search.py
Last active April 30, 2020 23:33
Lists the authors of Sunless Sea content as reported by a save file
#!/bin/bash
import re
owner_name_re = re.compile(r'"OwnerName": "(.*?)"')
save_text = """
<past save text here>
"""
base_game_authors = {'', "Adam Myers", "Alexis", "Amal El-Mohtar", "Castophrenia", "Chris Gardiner", "Elias", "Emily Short", "Emily Short, GDC", "FailbetterJames", "FredZeleny", "Gavin I", "Hogherd", "Liam Welton", "Mac", "Oliviaaivilo", "Prim Cash", "Richard", "Scotland", "Spacemarine10", "alexis", "alexiskennedy", "emshort", "henrytest", "meg jayanth"}
owners = sorted(set(author.group(1) for author in owner_name_re.finditer(save_text) if author.group(1) not in base_game_authors))
@wlerin
wlerin / paper.item.patch
Last active January 3, 2020 18:05
Hylotl objects fixed paper patch
[
[
{"op" : "test", "path" : "/learnBlueprintsOnPickup", "inverse" : true},
{"op" : "add", "path" : "/learnBlueprintsOnPickup", "value" : [] }
],
[
{"op" : "add", "path" : "/learnBlueprintsOnPickup/-", "value" : "waterlamp"},
{"op" : "add", "path" : "/learnBlueprintsOnPickup/-", "value" : "hylotlcalligraphy7"},
{"op" : "add", "path" : "/learnBlueprintsOnPickup/-", "value" : "hylotlcalligraphy8"},
{"op" : "add", "path" : "/learnBlueprintsOnPickup/-", "value" : "hylotlcalligraphy9"},
@wlerin
wlerin / rotate-video.sh
Created March 6, 2019 11:42 — forked from ViktorNova/rotate-video.sh
Rotate a video with FFmpeg (100% lossless, and quick)
$INPUTVIDEO='input.mp4'
$OUTPUTVIDEO='output.mp4'
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO
// ==UserScript==
// @name show Showroom streaming url
// @namespace https://gist.github.com/wlerin
// @description ShowroomのストリーミングURLを表示
// @include https://www.showroom-live.com/*
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @version 0.6
// ==/UserScript==
// Will display a streaming url in a box at the top of the screen
@wlerin
wlerin / ann_image_replacer.js
Last active August 8, 2017 20:17
ANN Image Replacer
// ==UserScript==
// @name ANN Image Replacer
// @namespace http://scripts.social48.net
// @version 0.1
// @description Replace small images from ANN with large ones.
// @author Social48
// @include http://www.allnightnippon.com/wp/assets/*
// @grant none
// @run-at document-start
// ==/UserScript==
@wlerin
wlerin / solar_system_objects.sql
Last active July 31, 2017 23:40 — forked from pamelafox/solar_system_objects.sql
solar_system_objects.sql
/*
Solar system objects
Adapted from: http://en.wikipedia.org/wiki/List_of_Solar_System_objects_by_size
Collected by: https://www.khanacademy.org/profile/patrick809/programs
*/
CREATE TABLE solar_system_objects(
body TEXT
, mean_radius NUMERIC /* km */
, mean_radius_rel NUMERIC /* relative to earth */
, volume NUMERIC /* 10^9 km^3 */
@wlerin
wlerin / pst_mods.sh
Created August 12, 2016 20:40
Planecape: Torment with most popular mods installation script
#!/bin/env bash
#Please specify path to Plansecape: Torment installer
export PST=./setup_planescape_torment_2.0.0.8.exe
#Please specify path to Planescape: Torment with Widescreen mod.
export WINEPREFIX=~/.planescapetorment
if [[ ! -f $PST ]]; then
echo "Please specify valid path to Planescape: Torment installer"
exit
fi
echo "Installing needed mods"
@wlerin
wlerin / tumblr_photoset_upload.py
Last active May 30, 2018 13:45
Upload a Photoset to Tumblr using the Python Requests library (http://docs.python-requests.org/en/latest/).
# Adapted from:
# https://gist.github.com/charlesbrandt/11eadaec114288d621fa
# https://gist.github.com/velocityzen/1242662
# https://gist.github.com/derekg/1198576
# https://groups.google.com/forum/#!msg/tumblr-api/0QxFn79B2n4/6MHC4GNHqp8J
# https://github.com/tumblr/jumblr/blob/master/src/main/java/com/tumblr/jumblr/request/MultipartConverter.java
import requests_oauthlib
import requests
import os.path