Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

Casper Zandbergen Amzd

🚀
View GitHub Profile
@Amzd
Amzd / rl-tracker-network-sort-players.user.js
Last active Apr 26, 2019
Adds sorting buttons for Rocket League tracker players
View rl-tracker-network-sort-players.user.js
// ==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 Apr 25, 2019
DONT USE WITH MY OTHER SCRIPT. Only shows 2v2 and 3v3 rank using css on https://rocketleague.tracker.network/live
View rl-tracker-network-2s-3s.user.js
// ==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 Apr 25, 2019
Disables the line charts on the live tracker page, there is too many of them and they make the page lag.
View rl-tracker-network-disable-charts.user.js
// ==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 Apr 25, 2019
Share the session with a url
View rl-tracker-network-share-session.user.js
// ==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 Apr 25, 2019
Filter by gamemode in the feed.
View rl-tracker-network-filter-feed.user.js
// ==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==
View rl-tracker-network-clear-session.user.js
// ==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 Jun 19, 2019 — 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.
View Instructions.md
@Amzd
Amzd / UIKitTabView.swift
Last active Jul 30, 2022
UIKitTabView. SwiftUI tab bar view that respects navigation stacks when tabs are switched (unlike the TabView implementation)
View UIKitTabView.swift
/// 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 Jun 27, 2022
Fix the back swipe gesture not working correctly in SwiftUI. https://stackoverflow.com/a/58345554/3393964
View Navigation.swift
/// 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 Oct 26, 2021
SwiftUI Binding wrappers for willSet and didSet
View Binding+didSet.swift
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))
})
}