Skip to content

Instantly share code, notes, and snippets.

@markphelan
markphelan / owmToOwfont.py
Created April 23, 2021 17:55
Convert OpenWeatherMap code to owfont TTF
def getWeatherIcon(code):
return {
# Thunder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# thunderstorm with light rain
200: "\uEB28",
# thunderstorm with rain
201: "\uEB29",
@markphelan
markphelan / checkPasswordExpiry.ps1
Created February 19, 2021 08:14
Windows Powershell - Display password expiry reminder (without RSAT)
$user = $env:USERNAME
$cmd = "net user /domain $($user)"
$cmdOutput = iex $cmd
$pwExpiryString = [regex]::Matches(($cmdOutput | select-string -Pattern 'Password expires'), '\d+\/\d+\/\d+ \d+:\d+:\d+').Value
$pwExpiry = [datetime]::ParseExact($pwExpiryString, 'dd/MM/yyyy HH:mm:ss', $null)
$now = Get-Date
$diff = (New-TimeSpan -Start $now -End $pwExpiry).Days
write-host "Password for $user valid for $diff days"
@markphelan
markphelan / campfire.ino
Created September 30, 2020 09:58
Arduino FastLED Flickering Campfire
#include <FastLED.h>
#define NUM_LEDS 50
#define DATA_PIN 2
#define CHIPSET WS2811
#define COLOR_ORDER RGB
CRGB leds[NUM_LEDS];
int colorMin = 20;
int colorMax = 55;
@markphelan
markphelan / cauldron.ino
Created September 30, 2020 09:10
Arduino FastLED Cauldron glow
#include <FastLED.h>
#define NUM_LEDS 50
#define FADE_SPEED 5
#define LIKELIHOOD 150
#define DATA_PIN 2
#define CHIPSET WS2811
#define COLOR_ORDER RGB
@markphelan
markphelan / spookyEyes.ino
Created September 30, 2020 08:44
Arduino FastLED Spooky Eyes
#include <FastLED.h>
#define NUM_EYES 10 // The number of PAIRS of eyes (total will be twice this)
#define FADE_SPEED 20 // How quick the eyes fade out (1-255)
#define EYE_LIKELIHOOD 20 // Higher number gives more eyes at one time (1-255)
#define DATA_PIN 2
#define CHIPSET WS2811
#define COLOR_ORDER RGB
@markphelan
markphelan / jpgToMp4.bat
Last active September 27, 2020 07:31
ffmpeg jpegs to mp4 on Windows
@echo off
(for %%i in (*.jpg) do @echo file '%%i') > mylist.txt
ffmpeg -f concat -i mylist.txt -c:v libx264 -b:v 1500k out.mp4