Skip to content

Instantly share code, notes, and snippets.

View kylejohnsonkj's full-sized avatar

Kyle Johnson kylejohnsonkj

  • Minnesota, USA
View GitHub Profile
@soffes
soffes / CLLocationCoordinate2D+Equatable.swift
Last active September 11, 2024 14:15
Add Equatable to CLLocationCoordinate2D
import CoreLocation
extension CLLocationCoordinate2D: Equatable {}
public func ==(lhs: CLLocationCoordinate2D, rhs: CLLocationCoordinate2D) -> Bool {
return lhs.latitude == rhs.latitude && lhs.longitude == rhs.longitude
}
@leshill
leshill / git-prunelocal
Last active June 21, 2024 14:50
Prune local tracking branches that have been removed upstream. Place file in your path (perhaps `~/bin` or `~/scripts`).
#!/bin/bash
#
# Prune local tracking branches that have been removed upstream.
# Your remote tracking branches can be removed automatically by setting `fetch.prune` to true or running `git fetch -prune`.
# Another command to clean up your remote tracking branches is `git remote prune <remote>`.
#
# Author: @leshill
# https://gist.github.com/leshill/9a1088a17f94cef24831
if [[ $# = 1 && $1 == '-n' ]]; then
@hughrawlinson
hughrawlinson / spotify_platform_oauth.sh
Last active November 23, 2024 22:34
Authenticate and get an oauth token for your Spotify app from the command line
#!/bin/bash
# spotify_platform_oauth.sh
#
# A script to quickly and easily generate Spotify oauth tokens given a client
# id, secret, and scope. Will authenticate a user via the browser.
# The app must have "http://localhost:8082/' as a redirect_uri
# spotify_client_creds.json should contain a spotify client id and secret pair
@Simon-Ince
Simon-Ince / gif-viewer.py
Last active February 8, 2024 10:20
Show gifs on and LED matrix using the hzeller/rpi-rgb-led-matrix Python library
#!/usr/bin/env python
import time
import sys
from rgbmatrix import RGBMatrix, RGBMatrixOptions
from PIL import Image, ImageSequence, GifImagePlugin
# Matrix size
size = 64, 64
@icostan
icostan / bitwarden.rb
Last active June 11, 2021 22:11
Transform exported iCloud passwords into Bitwarden's CSV format.
#!/usr/bin/env ruby
require 'csv'
CSV.open('bitwarden.csv', 'w') do |csv|
csv << ['folder', 'favorite', 'type', 'name', 'notes', 'fields', 'login_uri', 'login_username', 'login_password', 'login_totp']
CSV.open('~/Desktop/pm_export.csv', headers: true).each do |row|
data = ['', 0, 'login', row['Title'], '', '', row['Login URL'], row['Login Username'], row['Login Password'], '']
csv << data
@Delivator
Delivator / VLC_mp4_sout-all.reg
Created May 31, 2020 13:37
Adds "--sout-all --sout #display" arguments to VLC's .mp4 extension to play all available audio sources. Useful if you split audio tracks with shadowplay.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\VLC.mp4\shell\Open\command]
@="\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\" --started-from-file --sout-all --sout \"#display\" \"%1\""
@LambdAurora
LambdAurora / optifine_alternatives_fabric.md
Last active May 29, 2025 16:32
Recommended OptiFine alternatives on Fabric

The list is moving out!

If you share this list, please use this link instead: https://lambdaurora.dev/optifine_alternatives

It may still be only a redirection link, but it will have a better web display of the list soon. And the list being on GitHub/GitHub pages improves load times.

The gist version of this list will stop being updated.

Why?

@rintoandrews90
rintoandrews90 / xcframework_generate.md
Created December 25, 2020 07:05 — forked from lalkrishna/xcframework_generate.md
Create xcframework instead of Universal(fat) frameworks.

Advantages of xcframework

  • Support for multiple platforms in the same framework.
  • Support for Swift, Objective-C and C.
  • Support for dynamic frameworks and static libraries.
  • Support for Swift Package Manager.
  • End of fat binaries.

Steps to create Aggregate target:

  1. Open Current framework project
@NoahKamara
NoahKamara / CompoundPredicate.swift
Last active October 29, 2024 21:19
Combining New Swift Predicates
import Foundation
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
/// Allows you to use an existing Predicate as a ``StandardPredicateExpression``
struct VariableWrappingExpression<T>: StandardPredicateExpression {
let predicate: Predicate<T>
let variable: PredicateExpressions.Variable<T>
func evaluate(_ bindings: PredicateBindings) throws -> Bool {
// resolve the variable