Skip to content

Instantly share code, notes, and snippets.

View boehs's full-sized avatar

Evan Boehs boehs

View GitHub Profile
boehs / imagexss.svg
Last active February 16, 2024 04:17
View imagexss.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
boehs / Marquee.swift
Created December 1, 2023 18:46
SwiftUI marquee text
View Marquee.swift
// Marquee.swift
// lym
// Created by Evan Boehs on 11/30/23.
import SwiftUI
public struct MarqueeText : View {
boehs / MastodonLinker.swift
Last active December 30, 2023 17:25
Open Mastodon URL iOS SwiftUI
View MastodonLinker.swift
struct MastodonLinker {
var instance: String
var user: String
@Environment(\.openURL) private var openURL
func openMastodonLink() {
let urls = [
boehs /
Last active December 20, 2023 07:48
A little guide to UniFFI for iOS (using Proc macros)

Hi all! My app, Love Your Music, needs a cross platform backend shared between a swift and kotlin codebase. UniFFI has been an absolute joy to use, but unfortunately the setup process is a little bit poorly documented. No problem! I got you <3. This tutorial assumes you have a file structure like


Why Rust × Swift? A common use for rust is FFI, which we are actually doing right here anyway! But if you can FFI to Swift, you can FFI to anywhere. Cross platform apps writen in native code (e.g. apps with a Kotlin counterpart) benefit greatly from shared libraries and UniFFI. In addition, the Rust community is significantly larger, and so it's very likely you'll find crates that are more battletested, more featureful, higher performance, more documented, or even nonexistant in Swift.

boehs / gist:8903229790ac2f0d2f3bec0cb832cf6e
Last active November 29, 2023 22:27
10000 love letter words.
View gist:8903229790ac2f0d2f3bec0cb832cf6e
love loving lover like know want feel feeling think thinking one time never get make making friend friends would even see really day thing things say saying talk talking much way look looking could still tell back always girl someone heart ever hope hoping life year miss missing said guy wish let didn't try something every smile right need thought happy first come maybe people good eye ask everything person best kiss told night together give stop away crush hurt hurting care around last little boy please take start got made happen mean fall wait today hate well though anything long find keep beautiful end hand text remember better wonder nothing face letter laugh laughing sometime sometimes work else mind two call world walk month dream felt realize word sorry help fuck school thank hold perfect knew doesn't use sure hard won since anymore enough date bad cry lot actual move dear without next leave believe live seem head name saw moment guess kind change anyone relationship write met okay yet week turn anothe
boehs /
Created August 26, 2022 20:00
Make discord think you have spotify premium

Spotify premium discord features free

Discord has a number of features related to music streaming that are "exclusively" available for spotify premium members. Notably, listening parties. To restrict these features to spotify premium, discord runs a few premium checks that we can overwrite.


Why does this work? Shouldn't discord not have these permissions for non premium members, just like every other app?

Discord has the ability to control the playback of music for non premium members so they can pause the music on spotify if they are talking too long in a voice call. Spotify could have exclusively granted permission to pause music, instead of playing, pausing, changing songs, etc, but they did not, presumably because they did not have the fine grained control and did not care enough to implement it.

boehs / fr24.ts
Created October 30, 2023 15:56
FlightRadar24 scrapper for tracking specific flights (used in 2023 Lewiston, Maine Shootings Wikipedia article)
View fr24.ts
//[...document.querySelectorAll('a[data-flight-duration]')].map(e => e.getAttribute('data-flight-hex'))
interface FlightPlaybackPoints {
latitude: number
longitude: number
timestamp: number
type FlightPlaybackResponse = {
flight: {
boehs / parser.ts
Created September 7, 2023 13:28 times to sheet (for desmos)
View parser.ts
[...temp1.querySelectorAll('[_ngcontent-ng-c2304734222]')].map(e => e.textContent).filter(t => t.match(/^\d\d:\d\d/)).map((t,i) => {
let [m,s] = t.split(':')
return i + ',' + (Number(m) + (Number(s) * (100/60) / 100))
boehs / instagram-export-parser.ts
Created August 27, 2023 02:55
instagram data export profile parser
View instagram-export-parser.ts
[...document.querySelectorAll('a')].map(a => a.textContent).sort().join('\n')
boehs / owid.ts
Created July 5, 2023 17:25
OWID helper
View owid.ts
let global: {
[entity: string]: {
[year: number]: {
[col: string]: string
} = {}
async function pCSV(fName: string) {
const f: string[][] = (await Bun.file(fName + ".csv").text()).split("\n").map(l => l.split(','));