Skip to content

Instantly share code, notes, and snippets.

View Thann's full-sized avatar
✈️
Preserving my Freedom on Gitlab!

Jon Knapp Thann

✈️
Preserving my Freedom on Gitlab!
View GitHub Profile
@Thann
Thann / MoreIsAllYouNeed.gih
Last active February 14, 2021 10:20
"More Is All You Need" GIMP "image hose" brush
This file has been truncated, but you can view the full file.
@Thann
Thann / automosh.js
Created June 29, 2020 23:29
Auto-mosh bookmarklet
// One-liner to auto-mosh on photomosh.com
// Save this as the 'url' in a new bookmark and get moshing!
javascript:(function(){if (window.location.host != 'photomosh.com') window.location = 'https://photomosh.com'; else if (window.mosh) { clearInterval(window.mosh); window.mosh = 0; } else { var m = function(){document.getElementById('btn-mosh').click()}; window.mosh = setInterval(m, 5000); m();}})()
@Thann
Thann / run4
Created January 9, 2020 19:14
Runs a command, then kills it after a specified amount of time.
#!/usr/bin/env bash
# Runs a command, then kills it after a specified amount of time.
# USAGE: run4 10m watch date
${@:2} & PIDD=$!;
sleep "$1";
# echo "==== STOPPED ====";
kill -INT $PIDD;
@Thann
Thann / buskill.sh
Created January 2, 2020 21:16
Lock computer on USB remove
# Note: use following to determine "ID_MODEL" and replace "Micromax_A74" with it
# udevadm monitor --environment --udev
cat << EOF | sudo tee /etc/udev/rules.d/busKill.rules
ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_MODEL}=="Micromax_A74", RUN+="DISPLAY=:0 xscreensaver-command -lock"
EOF
sudo udevadm control --reload
@Thann
Thann / bcoin_raccoon_logo.svg
Last active January 18, 2019 02:04
Bcoin logo inspired by firfox
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Thann
Thann / ana.py
Created December 26, 2018 02:00
really slow anagram algorithm
import enchant
import itertools
sample = "atlas shrugged"
d = enchant.Dict("en_US")
for s in itertools.permutations(sample, len(sample)):
s = ''.join(s)
if all(d.check(p) for p in s.split(' ') if len(p)):
print('--->', s)
@Thann
Thann / tornado_rabbit.py
Last active November 1, 2018 06:09
RabbitWorker and RealtimePublisher for Tornado (python2)
## Mostly taken from https://github.com/pika/pika/blob/03542ef616a2a849e8bfb0845427f50e741ea0c6/docs/examples/tornado_consumer.rst
# -*- coding: utf-8 -*-
import json
import pika
import uuid
from tornado import gen
from tornado.log import app_log
from tornado.ioloop import IOLoop
from tornado.concurrent import Future
@Thann
Thann / hsd-miner-ubuntu.sh
Last active August 4, 2018 19:16
Mine handshake with docker!
# HSD docker-miner setup
### Install docker
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@Thann
Thann / sp
Last active December 22, 2019 20:05
Generate random South Park episode
#!/usr/bin/env node
// SouthPark random expisode generator
// Comment out seasons to exlude them =]
const num_episodes = Object.entries({
1: 13,
2: 18,
3: 17,
4: 17,
5: 14,
@Thann
Thann / gitlab-dark.css
Last active June 26, 2020 15:05
Dark Theme for Gitlab
/* thann */
.info-well {
background-color: #272727;
border-color: #555;
color: #777;
}
.well-segment {
border-bottom-color: #555 !important;
}
.count,