Skip to content

Instantly share code, notes, and snippets.

View ktnjared's full-sized avatar

Jared ktnjared

View GitHub Profile
@ecliptik
ecliptik / usb4vc-on-bookworm.md
Last active September 1, 2024 18:20
usb4vc Bookworm
@waynezhang
waynezhang / threads.net.js
Last active August 30, 2024 14:34
Userscript to load Following feed by default in threads.net
// ==UserScript==
// @name Threads
// @description Userscript to load Following feed by default in threads.net
// @match https://www.threads.net/*
// ==/UserScript==
sessionStorage.setItem("feed_variant", "FOLLOWING");
@JayBrown
JayBrown / addloc
Last active July 19, 2023 20:13
Add CLIs to /var/db/locationd/clients.plist (macOS Location Services)
#!/bin/zsh
# shellcheck shell=bash
# addloc 0.2.1 (beta)
# add CLIs to /var/db/locationd/clients.plist
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/local/bin:/opt/local/sbin:"$HOME"/.local/bin:"$HOME"/.local/sbin
rehash &>/dev/null
@ryancdavison
ryancdavison / iPad-Pro-Magic-Keyboard-Portrait-Mode-DIY-Smart-Connector-Cable.md
Last active April 3, 2025 15:36
iPad Pro 12.9 (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

iPad Pro 12.9" (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

I wanted my iPad Pro to be able to use the Magic Keyboard in portrait mode, but the current Smart Connector configuration does not allow this. With too much time on my hands, I made a short jumper cable using a section of USB cable, 5-pin POGO connectors (the 5-pin works using pins 1, 3, and 5, and removing pins 2 and 4), a small electrical project box, 3mm N52 magnets, and some epoxy and Sugru to pack everything into place. My cable and connections orientation had more to do with the boxes I found to encase the connector (with holes on the small end) than anything else. Obviously, there will be many ways to do this.

WARNING: Getting any of these steps wrong will probably ruin your iPad.

Note: These measurements are for the 12.9" (2020) model. The magnets did not line up and the polarity was different for my wife's iPad Pro 11" (2021).

![iPad-Pro-MmagicKeyboard-Jumper-Cable-min](https://user-images.githubusercontent.c

@zhuowei
zhuowei / safariinject.m
Last active October 22, 2021 17:15
Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// clang -fmodules -shared -Wall -Os -o libsafariinject.dylib safariinject.m
//
// If SIP off:
// DYLD_INSERT_LIBRARIES=$PWD/libsafariinject.dylib /Applications/Safari.app/Contents/MacOS/Safari
//
// If SIP on, you can demo this by manually removing Safari's code signing signature, but many
// features (eg saved logins) won't be readable by the resigned app:
// cp -a /Applications/Safari.app ./
// codesign --remove Safari.app/Contents/MacOS/Safari
@patriksvensson
patriksvensson / Oh-My-Posh.ps1
Last active August 3, 2023 10:12
Oh-My-Posh helper
[CmdletBinding()]
Param(
[switch]$Install,
[switch]$ListThemes,
[switch]$Force
)
$OhMyPosh = "$env:LOCALAPPDATA\Oh-My-Posh"
$OhMyPoshExe = Join-Path $OhMyPosh "oh-my-posh.exe"
$OhMyPoshThemes = "~\.poshthemes"
@christr
christr / update-dns.sh
Last active January 10, 2025 01:23 — forked from mhussain/update-dns.sh
Linode dynamic DNS updating script
#!/bin/bash
# Modified by Chris Richardson (https://github.com/christr and https://twitter.com/christr77) on 09/20/2020
# Previous versions of this script don't work because they hadn't been updated since 2012. There are now more steps involved to set this up.
# This script update is based on information found here: https://developers.linode.com/api/v4/domains-domain-id-records-record-id/#put
# You first must find out the domain ID and resource ID numbers. In order to do this follow the steps below.
# 1. Create a Linode API Key through your account profile at https://cloud.linode.com/dashboard. Give it rights to read/write to domains only.
# 2. From a shell run the following command: LINODE_API_KEY=[insert API key from step 1 here]
# 3. Run the following command to get the domain ID number for the domain you want to manage: curl -H "Authorization: Bearer $LINODE_API_KEY" https://api.linode.com/v4/domains/
@Splaxi
Splaxi / download-latest-release.ps1
Last active March 20, 2025 23:34 — forked from MarkTiedemann/download-latest-release.ps1
Download latest GitHub release via Powershell
# Download latest dotnet/codeformatter release from github
$repo = "jgm/pandoc"
$filenamePattern = "*x86_64.zip"
$pathExtract = "C:\Tools\pandoc"
$innerDirectory = $true
$preRelease = $false
if ($preRelease) {
$releasesUri = "https://api.github.com/repos/$repo/releases"
@patrick330602
patrick330602 / profile.ps1
Created March 13, 2020 02:52
My Windows Terminal Profile used during WSLConf (last two in profiles are the profiles I used for demo videos and live demo)
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"disabledProfileSources": [
"Windows.Terminal.Wsl"
],
"profiles": {
"defaults": {
@fawzisal
fawzisal / .bash_profile
Last active September 18, 2020 02:47
My .bsah_profile file
#### .bash_profile #################################################
#
# Fawzi Salama
# Sep 17, 2020
#
####################################################################
#⌾⌾⌾⌾⌾⌾⌾⌾ VARIABLES ⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾⌾#
#◌◌◌◌◌◌◌◌ path definitions ◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌#
#◌◌◌◌◌◌◌◌ other paths ◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌#