Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# Linux usage: ./extract_tampermonkey_script.py "/home/<USER>/.config/<BROWSER>/Default/Local Extension Settings/<EXTENSION_ID>"
# i.e.: ./extract_tampermonkey_script.py "/home/foo/.config/google-chrome-beta/Default/Local Extension Settings/gcalenpjmijncebpfijmoaglllgpjagf"
# Mac usage: ./extract_tampermonkey_script.py "/Users/<USER>/Library/Application Support/Google/Chrome/Default/Local Extension Settings/<EXTENSION_ID>/"
# i.e.: ./extract_tampermonkey_script.py "/Users/foo/Library/Application Support/Google/Chrome/Default/Local Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo/"
import leveldb
import sys
import re
@MrTact
MrTact / LogText.kt
Last active January 11, 2019 06:23
Easily log some text to a file in Kotlin
File("log.txt").printWriter().use { out ->
params.list.forEach(out::println)
}
@MrTact
MrTact / RetrofitClient.kt
Last active April 29, 2019 16:38
Object wrapper to easily create a retrofit client in Kotlin
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.module.kotlin.KotlinModule
import retrofit2.Retrofit
import retrofit2.converter.jackson.JacksonConverterFactory
/**
* @return A callable instance of a retrofit client based on the provided API class
*
* @param baseUrl: The base URL for the api host