Skip to content

Instantly share code, notes, and snippets.

@kylehughes
kylehughes / .swift-format
Last active March 24, 2025 04:33
The perfect, comprehensive swift-format (600.0.0) configuration.
{
"indentBlankLines": false,
"indentConditionalCompilationBlocks": false,
"indentSwitchCaseLabels" : false,
"indentation": {
"spaces": 4
},
"lineBreakAroundMultilineExpressionChainComponents": true,
"lineBreakBeforeControlFlowKeywords": false,
"lineBreakBeforeEachArgument": true,
@Tomn94
Tomn94 / wish-it-were-a-script.md
Last active January 23, 2025 16:55
💻 What to do on new macOS installs

Current — January 2025

  1. During Setup Assistant, Choose French as language and France as region.
    Add English (US) as 2nd preferred language (to be able to search for emoji in French+English, etc.), remove any keyboard besides ABC.
    In Vision settings, enable ⌃-2-fingers zoom and automatic switch between Light & Dark mode.
    Don’t import any backup, connect to iCloud, create an account without touching the avatar (guarantees it’ll use iCloud’s), customize data sharing, enable FileVault, add a fingerprint for Touch ID, set up Apple Pay.

  2. Download apps on the Mac App Store:
    Pages, Numbers, Keynote, Pixelmator Pro, Final Cut Pro, Apple Configurator, 1Blocker for Safari, Shareful, Messenger, Ivory, Mactracker, Apple Developer, TestFlight, Key Codes, Boop.

@khalidx
khalidx / node-typescript-esm.md
Last active April 15, 2025 14:15
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@codingtony
codingtony / fraserJsonToCSV.sh
Last active March 22, 2025 16:30
Get school list from fraser institute as CSV
#!/bin/bash
wget https://www.compareschoolrankings.org/api/v1/schools.json -O school.json
jq '.data[] | { sid:.sid, title:.title, province:.province, type:.schoolType, rank:.schoolInfoData."Rank This Yr", city:.schoolInfoData.SchoolCity, pubOrPriv:.schoolInfoData.IND_or_PUB,lang:.schoolInfoData.SchoolLanguage,admin:.schoolInfoData.AdminBodyName } ' school.json | jq -rn -L. 'include "json2csv"; [inputs]|json2csv' > school.csv
@giuliomagnifico
giuliomagnifico / padd.sh
Last active January 7, 2023 16:22
Custom PADD layout for 800x480px displays
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC1091
# shellcheck disable=SC2154
# PADD
#
# A more advanced version of the chronometer provided with Pihole
# SETS LOCALE
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@IanColdwater
IanColdwater / twittermute.txt
Last active April 14, 2025 16:31
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@danieleggert
danieleggert / GPG and git on macOS.md
Last active March 6, 2025 20:45
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files: