Skip to content

Instantly share code, notes, and snippets.

View swanee3d's full-sized avatar
🦊
Tinkering

swanee3d

🦊
Tinkering
View GitHub Profile
@KartikTalwar
KartikTalwar / JavaScriptRepeat.js
Created April 5, 2012 00:12
Make a JavaScript function repeat every x seconds
function refreshData()
{
x = 5; // 5 Seconds
// Do your thing here
setTimeout(refreshData, x*1000);
}
@spikegrobstein
spikegrobstein / nginx.conf
Last active July 26, 2025 20:11
nginx config for proxying requests for plex over a hostname-based virtualhost.
upstream plex-upstream {
# change plex-server.example.com:32400 to the hostname:port of your plex server.
# this can be "localhost:32400", for instance, if Plex is running on the same server as nginx.
server plex-server.example.com:32400;
}
server {
listen 80;
# server names for this server.
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active September 15, 2025 23:56
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
mkdir -p ~/.ssh
# generate new personal ed25519 ssh keys
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>"
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
@wandernauta
wandernauta / sp
Last active September 17, 2025 08:54
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@dwhacks
dwhacks / Attiny_gps_beacon.ino
Created May 4, 2014 18:54
Attiny softserial and gps
/*
Original code come from Adafruit GPS logger shield kit - v1.1
http://www.adafruit.com/products/98
http://www.ladyada.net/make/gpsshield/download.html
All of this example Arduino code is Public Domain. Enjoy!
http://en.wikipedia.org/wiki/GNU_General_Public_License
Modified by DWHacks for use with U-blox PCI-5S.
Info about U-blox PCI-5S here: http://emerythacks.blogspot.ca/2013/01/u-blox-pci-5s-cheap-gps-module-for-your.html
@kriegsman
kriegsman / TimedPlaylist.ino
Last active February 12, 2022 19:36
Timed playlist of animations, designed for sequencing and performance.
#include "FastLED.h"
// This sketch shows one way to define a 'timed playlist'
// of animations that automatically rotate on a custom schedule.
//
// A "ResetPlaylist" method is provided so that the playlist can be
// restarted from a custom external trigger, e.g., a button or event.
// For demonstration purposes, the playlist is reset if the
// sketch receives a letter "r" on the serial port.
//
@atuline
atuline / demoreel100withbutton.ino
Last active October 12, 2022 21:03
Demoreel100 with a button
/*
Title: DemoReel100 with Button
By: Mark Kriegsman
Button added by: Andrew Tuline
@shivshank
shivshank / vox_to_obj_exporter.py
Last active January 26, 2025 14:00
Exports from MagicaVoxel VOX to OBJ. Can preserve all edges for easy editing in a program like Blender.
"""
This script is designed to export a mass amount of MagicaVoxel .vox files
to .obj. Unlike Magica's internal exporter, this exporter preserves the
voxel vertices for easy manipulating in a 3d modeling program like Blender.
Various meshing algorithms are included (or to be included). MagicaVoxel
uses monotone triangulation (I think). The algorithms that will (or do)
appear in this script will use methods to potentially reduce rendering
artifacts that could be introduced by triangulation of this nature.
@m-hofmann
m-hofmann / main.py
Created October 6, 2016 17:14
QListWidget PyQt Example
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QListWidget, QVBoxLayout, QLabel, QPushButton, QListWidgetItem, \
QHBoxLayout
class CustomQWidget(QWidget):
def __init__(self, parent=None):
super(CustomQWidget, self).__init__(parent)
label = QLabel("I am a custom widget")
@swyngaard
swyngaard / readme
Last active June 26, 2024 17:10
FFMPEG record desktop at 60 frames per second
Install ffmpeg or libav-tools.
Change -video_size to match your desktop resolution.
Record your desktop by executing the script:
./record.sh
Record without audio as follows:
./record_no_audio.sh