Skip to content

Instantly share code, notes, and snippets.

@harmtemolder
harmtemolder / alfred-custom-searches.md
Last active June 9, 2021 10:06
Alfred Custom Searches
Website Custom Search URL
Deepl alfred://customsearch/Translate%20%27%7Bquery%7D%27%20to%20English%20on%20Deepl/deepl/utf8/nospace/https%3A%2F%2Fwww.deepl.com%2Ftranslator%23xx%2Fen%2F%7Bquery%7D
OpenStreetMap alfred://customsearch/Search%20OpenStreetMap%20for%20%27%7Bquery%7D%27/osm/utf8/nospace/https%3A%2F%2Fwww.openstreetmap.org%2Fsearch%3Fquery%3D%7Bquery%7D
GitHub alfred://customsearch/Search%20GitHub%20for%20%27%7Bquery%7D%27/gh/utf8/%2B/https%3A%2F%2Fgithub.com%2Fsearch%3Fq%3D%7Bquery%7D
GitHub (my repositories) [alfred://customsearch/
@harmtemolder
harmtemolder / protonmail-trash-all-in-folder.js
Created October 19, 2019 07:55
Pasting this script in your developer console will select all emails in the current view, click the trash button and repeat
(function myLoop (i) {
setTimeout(function () {
$('#selectAll').click();
setTimeout(() => {$('.toolbar-btn-trash')[0].click()}, 2000);
if (--i) myLoop(i);
}, 4000)
})(25);
import argparse
from math import pi
import numpy as np
import os
import pandas as pd
MIN_RADIUS = 0.5
MAX_RADIUS = 2.0
MIN_HEIGHT = 0.5
MAX_HEIGHT = 2.0
@harmtemolder
harmtemolder / numpy_train_test_split.py
Last active March 14, 2019 10:27
Split a dataframe between a train and test dataframe using only numpy
np.random.seed(seed=42) # makes result reproducible
msk = np.random.rand(len(df)) < 0.8
train_df = df[msk]
eval_df = df[~msk]
import numpy as np
import os
import pandas as pd
import shutil
import tensorflow as tf
# Fix "OMP: Error #15: Initializing libiomp5.dylib, but found
# libiomp5.dylib already initialized."
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'