Skip to content

Instantly share code, notes, and snippets.

View weo3dev's full-sized avatar

weo3 weo3dev

View GitHub Profile
//
// AppView.swift
//
//
// Created by Saroar Khandoker on 05.05.2021.
//
import AuthClient
import AuthClientLive
import AuthenticationView
@okla
okla / DragGesture+Velocity.swift
Created February 17, 2021 16:36
SwiftUI DragGesture velocity
extension DragGesture.Value {
var velocity: CGPoint {
let decelerationRate = UIScrollView.DecelerationRate.normal.rawValue,
d = decelerationRate/(1000.0*(1.0 - decelerationRate))
return CGPoint(x: (location.x - predictedEndLocation.x)/d,
y: (location.y - predictedEndLocation.y)/d)
}
@ts95
ts95 / Dial.swift
Last active March 30, 2025 16:04
Dial component in SwiftUI
import SwiftUI
struct Dial: View {
@Binding public var value: Double
public var minValue: Double = 0
public var maxValue: Double = .greatestFiniteMagnitude
public var divisor: Double = 1
public var stepping: Double = 1
@State private var dialAngle: Angle = .zero
@State private var dialShadowAngle: Angle = .zero
@kieranb662
kieranb662 / SwiftUI-DragGesture-Implementations.md
Last active April 3, 2025 12:22
[Drag Gesture Implementations] #SwiftUI

Drag Gesture Implementations

Simple Example 1

Here I used @State CGSize values to represent both the viewState and the dragState

struct Example1: View {
    @State var viewState: CGSize = .zero
 @State var dragState: CGSize = .zero
@chriswhong
chriswhong / scrape.js
Created April 22, 2019 03:58
Decrypting Amtrak's real-time train location geoJSON feed
// decrypting Amtrak's real-time train location geoJSON feed
// based on https://github.com/Vivalize/Amtrak-Train-Stats
const fetch = require('node-fetch');
const CryptoJS = require('crypto-js');
// this is the xhr call done by https://www.amtrak.com/track-your-train.html containing encrypted train location data
const dataUrl = 'https://maps.amtrak.com/services/MapDataService/trains/getTrainsData';
// these constants are pulled from RoutesList.v.json, which is an object with keys 'arr', 's', and 'v'
const sValue = '9a3686ac'; // found at s[8]
@lxe
lxe / goes16-rtlsdr.md
Last active March 9, 2026 22:27
Receive GOES-16 and GOES-17 Images with a Raspberry Pi and RTL-SDR dongle
@jwilson8767
jwilson8767 / es6-element-ready.js
Last active February 24, 2025 08:50
Wait for an element to exist. ES6, Promise, MutationObserver
// MIT Licensed
// Author: jwilson8767
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/
@guycalledseven
guycalledseven / manual-uninstall-paragon-ntfs.sh
Last active December 28, 2025 02:27
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@tkersey
tkersey / .2026.md
Last active March 13, 2026 12:36
For future reference but maybe not.

Quick access

2026

March

  • The plumbing calculus is a typed language for describing how AI agents connect and communicate. It has formal mathematical foundations and supports session types for specifying protocols between agents. The compiler checks that agent graphs are well-formed before they run.

> This is the first public release of the compiler, interpreter, and MCP server, available for research and personal use.

@koenpunt
koenpunt / chosen-bootstrap.css
Last active December 17, 2025 18:08
Bootstrap 3.0 theme for Chosen
select.form-control + .chosen-container.chosen-container-single .chosen-single {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;