Skip to content

Instantly share code, notes, and snippets.

View Amzd's full-sized avatar
🚀

Casper Zandbergen Amzd

🚀
View GitHub Profile
@Amzd
Amzd / rl-tracker-network-sort-players.user.js
Last active April 26, 2019 09:23
Adds sorting buttons for Rocket League tracker players
// ==UserScript==
// @name Tracker Network Sort Players
// @namespace https://rocketleague.tracker.network
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://rocketleague.tracker.network/live*
// @grant GM_addStyle
// ==/UserScript==
@Amzd
Amzd / rl-tracker-network-2s-3s.user.js
Last active April 25, 2019 15:25
DONT USE WITH MY OTHER SCRIPT. Only shows 2v2 and 3v3 rank using css on https://rocketleague.tracker.network/live
// ==UserScript==
// @name Tracker Network 2s, 3s
// @namespace https://rocketleague.tracker.network
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://rocketleague.tracker.network/live*
// @grant GM_addStyle
// @run-at document-start
// @require http://code.jquery.com/jquery-3.3.1.min.js
@Amzd
Amzd / rl-tracker-network-disable-charts.user.js
Created April 25, 2019 10:04
Disables the line charts on the live tracker page, there is too many of them and they make the page lag.
// ==UserScript==
// @name Tracker Network Disable Live Line Charts
// @namespace https://rocketleague.tracker.network
// @version 0.1
// @description Disables the line charts on the live tracker page, there is too many of them and they make the page lag.
// @author You
// @match https://rocketleague.tracker.network/live*
// @grant none
// @run-at document-start
// @require http://code.jquery.com/jquery-3.3.1.min.js
@Amzd
Amzd / rl-tracker-network-share-session.user.js
Last active April 25, 2019 15:10
Share the session with a url
// ==UserScript==
// @name Tracker Network Share Session
// @namespace https://rocketleague.tracker.network
// @version 0.1
// @description Share the session to a url
// @author You
// @match https://rocketleague.tracker.network/live*
// @grant none
// @run-at document-start
// @require http://code.jquery.com/jquery-3.3.1.min.js
@Amzd
Amzd / rl-tracker-network-filter-feed.user.js
Created April 25, 2019 13:44
Filter by gamemode in the feed.
// ==UserScript==
// @name Tracker Network Filter Feed
// @namespace https://rocketleague.tracker.network
// @version 0.1
// @description Filters to gamemode in the feed.
// @author You
// @match https://rocketleague.tracker.network/live*
// @grant GM_addStyle
// ==/UserScript==
@Amzd
Amzd / rl-tracker-network-clear-session.user.js
Created April 26, 2019 08:37
Adds delete all players button
// ==UserScript==
// @name Tracker Network Clear Session
// @namespace https://rocketleague.tracker.network
// @version 0.1
// @description Share the session to a url
// @author You
// @match https://rocketleague.tracker.network/live*
// @grant none
// @run-at document-start
// @require http://code.jquery.com/jquery-3.3.1.min.js
@Amzd
Amzd / Instructions.md
Last active June 19, 2019 10:35 — forked from alloy/Instructions.md
Run iOS unit tests (in a Xcode workspace) when a file changes and *only* those tests related to the changed file. Also trims otest output and colors test results.
@Amzd
Amzd / UIKitTabView.swift
Last active September 29, 2024 12:32
UIKitTabView. SwiftUI tab bar view that respects navigation stacks when tabs are switched (unlike the TabView implementation)
/// An iOS style TabView that doesn't reset it's childrens navigation stacks when tabs are switched.
public struct UIKitTabView: View {
private var viewControllers: [UIHostingController<AnyView>]
private var selectedIndex: Binding<Int>?
@State private var fallbackSelectedIndex: Int = 0
public init(selectedIndex: Binding<Int>? = nil, @TabBuilder _ views: () -> [Tab]) {
self.viewControllers = views().map {
let host = UIHostingController(rootView: $0.view)
host.tabBarItem = $0.barItem
@Amzd
Amzd / Navigation.swift
Last active July 6, 2023 03:34
Fix the back swipe gesture not working correctly in SwiftUI. https://stackoverflow.com/a/58345554/3393964
/// Fixed swipe gesture NavigationLink
struct NavigationLink<Destination: View, Label:View>: View {
var destination: Destination
var label: () -> Label
public init(destination: Destination, @ViewBuilder label: @escaping () -> Label) {
self.destination = destination
self.label = label
}
@Amzd
Amzd / Binding+didSet.swift
Last active September 20, 2023 05:27
SwiftUI Binding wrappers for willSet and didSet
extension Binding {
/// Wrapper to listen to didSet of Binding
func didSet(_ didSet: @escaping ((newValue: Value, oldValue: Value)) -> Void) -> Binding<Value> {
return .init(get: { self.wrappedValue }, set: { newValue in
let oldValue = self.wrappedValue
self.wrappedValue = newValue
didSet((newValue, oldValue))
})
}