Skip to content

Instantly share code, notes, and snippets.

@quentinms
quentinms / subreddit-data-dumper
Created May 11, 2013 16:30
A python script that gets the list of the most popular subreddits and their number of subscribers
import json
import time
from time import sleep
from urllib2 import Request
from urllib2 import build_opener
from urllib2 import HTTPError
import Cookie
def get_subreddits():
@quentinms
quentinms / Preferences.sublime-settings
Last active August 29, 2015 14:27
Sublime Text 3 Preferences
{
"caret_style": "phase",
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"default_encoding": "UTF-8",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"font_face": "Source Code Pro",
"font_size": 14,
"highlight_line": true,
"highlight_modified_tabs": true,
@quentinms
quentinms / gps_tag.js
Last active September 19, 2020 19:18
Tag GoPro videos with GPS metadata in Photos.app (macOS)
// GoPro Hero 5/6 videos have GPS metadata but Photos doesn't recognize them for whatever reason.
// This script loads selected items from Photos, analyzes them with exiftool, and adds back the GPS metadata in a way Photos can understand.
// Run this in Script Editor, Automator or save it as a service. Change the export folder.
// Requires exiftool (https://www.sno.phy.queensu.ca/~phil/exiftool/)
function run() {
const Photos = new Application("Photos")
Photos.includeStandardAdditions = true
const app = Application.currentApplication()
2020/11/06 10:36:00 [INFO] backend/local: apply calling Apply
2020/11/06 10:36:00 [INFO] terraform: building graph: GraphTypeApply
2020/11/06 10:36:00 [DEBUG] adding implicit provider configuration provider.google, implied first by google_project_iam_policy.testing (prepare state)
2020/11/06 10:36:00 [DEBUG] ProviderTransformer: "google_spanner_instance.test (prepare state)" (*terraform.NodeApplyableResource) needs provider.google
2020/11/06 10:36:00 [DEBUG] ProviderTransformer: "data.google_iam_policy.testing (prepare state)" (*terraform.NodeApplyableResource) needs provider.google
2020/11/06 10:36:00 [DEBUG] ProviderTransformer: "google_spanner_instance.test" (*terraform.NodeApplyableResourceInstance) needs provider.google
2020/11/06 10:36:00 [DEBUG] ProviderTransformer: "google_project_iam_policy.testing (prepare state)" (*terraform.NodeApplyableResource) needs provider.google
2020/11/06 10:36:00 [DEBUG] ProviderTransformer: "google_project.testing (prepare state)" (*terraform.NodeApplyableResource) needs
@quentinms
quentinms / caddy-config.json
Created April 11, 2022 14:31
Running LanguageTool locally
{
"apps": {
"http": {
"servers": {
"localhost": {
"listen": [
":9081"
],
"automatic_https": {
"disable_redirects": true
@quentinms
quentinms / scriptable-widget-adaptsh.js
Last active September 25, 2022 17:43
Scriptable.app code for an adapt.sh widget. 100% written from my phone so indentation is all over the place and barely any error checks.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: bolt;
async function getForecast() {
const url = "https://adapt.sh/forecast"
const webview = new WebView()
await webview.loadURL(url)