Skip to content

Instantly share code, notes, and snippets.

View pugson's full-sized avatar

pugson pugson

View GitHub Profile
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active February 3, 2026 15:58
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@marckohlbrugge
marckohlbrugge / wipchat.coffee
Last active September 26, 2020 01:36
ubersicht widget that pulls in next wipchat todo to work on
# This is a simple example Widget, written in CoffeeScript, to get you started
# with Übersicht. For the full documentation please visit:
#
# https://github.com/felixhageloh/uebersicht
#
# You can modify this widget as you see fit, or simply delete this file to
# remove it.
# this is the shell command that gets executed every time this widget refreshes
command: "whoami"
@argyleink
argyleink / easings.css
Created February 26, 2018 22:34
Handy CSS properties for easing functions
:root {
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335);
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
@spyesx
spyesx / rsync_backup.sh
Last active November 24, 2025 17:10
Rsync backup excluding node_modules
# Backup files
#https://explainshell.com/explain?cmd=rsync+-azuv+--delete+--progress+--exclude+%27node_modules%27
rsync -auvhp --delete --exclude=node_modules [source] [destination]
# Remove all node_modules folders
# https://explainshell.com/explain?cmd=find+.+-name+%22node_modules%22+-type+d+-prune+-exec+rm+-rf+%27%7B%7D%27+%2B
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
// This is a worker that can be deployed in a desperate situation in order
// to disable all service worker caching by overwriting the running worker
// with a no-op worker.
//
// Keep it close for when you need it.
self.addEventListener('install', () => {
// Activate immediately, taking control from any broken service workers
self.skipWaiting();
});

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode
@jamieparfet
jamieparfet / macOS-mojave-iso.sh
Last active December 10, 2024 14:38
Create an ISO from the mojave installer app
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
@juliendargelos
juliendargelos / imagemagick-trim-transparent.sh
Last active November 20, 2025 13:04
Imagemagick commands that trims transparent pixels from an image.
# Trim a single "input.png" image and save to "output.png"
magick input.png -trim +repage output.png
# Trim a single "image.png" image and overwrite the original file (based on @enijar comment)
mogrify -trim +repage image.png
# Trim and overwrite all png images from the working directory (based on @enijar comment)
mogrify -trim +repage *.png
@pugson
pugson / readme.md
Created April 4, 2019 15:11
How to fix unknown host on .dev TLD after using puma-dev

How to fix unknown host on .dev TLD after using puma-dev

  1. Run scutil --dns
  2. Check if you have something like this in your output:
resolver #8
  domain   : dev
  nameserver[0] : 127.0.0.1
  port     : 9253
 flags : Request A records, Request AAAA records
@bonniss
bonniss / github-search-cheatsheet.md
Last active January 20, 2026 20:00
Github search cheatsheet from official docs.

Github Search Cheat Sheet

GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.

For more information, visit our search help section.

Basic search