Skip to content

Instantly share code, notes, and snippets.

Avatar
:atom:

Dennis Muensterer dnnsmnstrr

:atom:
View GitHub Profile
@dnnsmnstrr
dnnsmnstrr / Create Gist.js
Created Nov 7, 2021
A scriptable for creating/updating gists
View Create Gist.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: brown; icon-glyph: file-code;
// To use this script, you need to configure an OAuth App on GitHub.
// Follow the instructions on the link below to create your OAuth App.
//
// When you are asked to put in a redirect URL, you should put the URL for running this script in Scriptable. Assuming the name of this script is "Create Gist", the URL is scriptable:///run?scriptName=Create%20Gist
//
// https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/
//
@dnnsmnstrr
dnnsmnstrr / btt.sh
Created Aug 1, 2021
Launch BetterTouchTool's named triggers from the command line. Requires the BTT webserver interface to be active.
View btt.sh
#!/bin/bash
if [ -z "$1" ]
then
echo "No trigger supplied"
exit
fi
curl "http://127.0.0.1:12345/trigger_named/?trigger_name=$*"
@dnnsmnstrr
dnnsmnstrr / camera.py
Created Mar 13, 2021
Takes a picture using the raspberry pi camera and saves the resulting image with datetime filename
View camera.py
from picamera import PiCamera
import time
import os
camera = PiCamera()
camera.start_preview()
time.sleep(3)
currentTime = time.strftime("%Y-%m-%d-%T")
@dnnsmnstrr
dnnsmnstrr / datetime.py
Last active Mar 11, 2021
Displays the full date and time on a waveshare e-paper display (2.13in V2)
View datetime.py
#!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
import logging
@dnnsmnstrr
dnnsmnstrr / response.json
Last active Oct 21, 2021
My playlists on Spotify available via a custom personal API. (the response.json is the data source)
View response.json
{
"current": "https://open.spotify.com/playlist/6TYM6OrQUrYOdUqqB1mSdq?si=bjn4xw8gRKC9IDTlfaxvtw",
"chill": "https://open.spotify.com/playlist/0x0ZQcmLsamIx5bF5px2Tc?si=JRKDeoYdS02T66Lhlo7V_w",
"spring": "https://open.spotify.com/playlist/68z163CKUImi0QB6ZpSigr?si=H-rEE3kMQ8WcEfgg-c6iQw",
"summer": "https://open.spotify.com/playlist/5wpb3PdQOzFb3jurTcVfZO?si=vMQ-JzRIRNqgCeGFTIZrXQ",
"autumn": "https://open.spotify.com/playlist/22XncHS02W5RWJ1yM4lV6l?si=2yW8i1WbSp6kk5gjEHXMIQ",
"winter": "https://open.spotify.com/playlist/67SvJfEofXhdIXwsuUJbCJ?si=DWOzFjMqQkqokKPueAGZaA",
"sleep": "https://open.spotify.com/playlist/13RQxSzWqVg3fHlalxlyhC?si=x8ppL0ZuSjKv8if8dQM39g",
"coding": "https://open.spotify.com/playlist/0camicGxGNwB9YS66nAwtb?si=ZpBdqb-7RWiDIiRt0g-asw",
"sports": "https://open.spotify.com/playlist/4X1uZRUIccnwcofS8QjBku?si=MK9RWVXWQaShcaiuyfJx6A",
View paste
# Say a random curseword
function cuss () {
CUSS_WORDS=("fuck" "shit" "bitch" "asshole" "motherfucker" "cunt")
VOICES=("Albert" "Zarvox" "Alex" "Bad News" "Deranged" "Trinoids" "Hysterical")
RANDOM_VOICE=${VOICES[$( jot -r 1 0 $((${#VOICES[@]} - 1)) )]}
CUSS=${CUSS_WORDS[$( jot -r 1 0 $((${#CUSS_WORDS[@]} - 1)) )]}
echo $CUSS
say ${1:-$CUSS} -v ${2:-$RANDOM_VOICE}
}
@dnnsmnstrr
dnnsmnstrr / snippets.md
Last active Sep 28, 2020
Shell Snippets
View snippets.md

Shell Snippets

Most of these should work in bash and/or zsh

macOS

Get network location

CURRENT_LOCATION=$(scselect | tail -n +2 | egrep '^\ +\*' | cut -d \( -f 2- | sed 's/)$//')
@dnnsmnstrr
dnnsmnstrr / index.html
Last active Sep 14, 2020 — forked from labnol/index.html
Website in iFrame
View index.html
<iframe src="https://muensterer.xyz" width="1920" height="1080" frameborder="0" style="border:0"></iframe>
View projects.md