Skip to content

Instantly share code, notes, and snippets.

View spencerkittleson's full-sized avatar

Spencer Kittleson spencerkittleson

  • NICE / MindTouch
  • San Diego, CA
View GitHub Profile
@aallan
aallan / watch_code.py
Last active April 3, 2024 17:58
Example MicroPython watch code for the RP2040 1.28-inch TFT display watch board
# Digital Watch Face
#
# Author: Tony Goodhew (28th January 2023)
# Updates: Toby Roberts, Andrew Scheller & Alasdair Allan (March 2023)
#
# Original code taken from https://www.instructables.com/Digital-Watch-Display-MicroPython/
from machine import Pin,I2C,SPI,PWM
import framebuf
import time
@nanasess
nanasess / Jwks.cs
Created August 8, 2017 01:04
RSA public key to JWKs(JSON Web Key Set) for C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.OpenSsl;
namespace TestCommands
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 00:07
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@wookietreiber
wookietreiber / default.pa
Created November 29, 2015 10:44
stream with ffmpeg, pulseaudio.
# To record both mic and other audio input sources we need to add a named output sink. See:
# http://www.linuxquestions.org/questions/linux-software-2/alsa-and-pulseaudio-recording-multiple-input-devices-877614/
# http://www.youtube.com/watch?v=oJADNOY615Y&feature=player_embedded
# Add this to your /etc/pulse/default.pa file
load-module module-null-sink sink_name=stream
load-module module-loopback latency_msec=5 sink=stream
load-module module-loopback latency_msec=5 sink=stream