Skip to content

Instantly share code, notes, and snippets.

View vincent-peng's full-sized avatar

Vincent Peng vincent-peng

  • Sydney, Australia
View GitHub Profile
@jordansinger
jordansinger / Settings.swift
Created February 20, 2021 18:30
iOS 6 Settings built in SwiftUI
//
// Settings.swift
// Settings
//
// Created by Jordan Singer on 2/20/21.
//
import SwiftUI
struct Settings: View {
@ethanhuang13
ethanhuang13 / FacebookAuth.swift
Last active March 28, 2024 08:24
FacebookAuth is for iOS app developers who need to support Facebook login but don't want to use the official SDK
//
// FacebookAuth.swift
// GitHub: ethanhuang13
// Twitter: @ethanhuang13
import AuthenticationServices
import SafariServices
/*
Updated:
@colemickens
colemickens / amiibo-emulation-with-linux-vm.md
Last active June 27, 2024 12:20
amiibo-emulation-with-linux-vm.md

Easy Amiibo Emulation - https://bit.ly/2z0m09k

(^ that's a short-link to this page, so you can open it in Linux)

Some users are discussing this guide in #hacking on the JoyConDroid Discord: https://discord.gg/SQNEx9v.

DO NOT ask for, or share links to, Amiibo bins in the comments! They will be removed. Thank you for understanding.

(Windows|Linux PC) + JoyControl + Bluetooth = AMIIBO EMULATION

@Treeki
Treeki / TurnipPrices.cpp
Last active May 27, 2024 15:18
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@danielt1263
danielt1263 / RetryWhen.swift
Last active April 25, 2023 09:40
I have implemented RetryWhen in Combine.
//
// RetryWhen.swift
// CombineSandbox
//
// Created by Daniel Tartaglia on 9/27/19.
// Copyright © 2019 Daniel Tartaglia. MIT License.
//
import Foundation
import Combine
@sgr-ksmt
sgr-ksmt / AnyObserver+.swift
Last active September 9, 2022 10:07
MVVM + RxSwift + Property Wrapper
extension AnyObserver {
static func create<E>(_ relay: PublishRelay<E>) -> AnyObserver<E> {
return .init { event in
guard case let .next(value) = event else { return }
relay.accept(value)
}
}
static func create<E>(_ relay: BehaviorRelay<E>) -> AnyObserver<E> {
return .init { event in
@PeterLi
PeterLi / Encrypted Realm with secret in keychain in app supporting background fetch intermittently causes realm to fail to initialize and crash app at try! - SOLVED
Last active February 8, 2023 20:53
Encrypted Realm with secret in keychain in app supporting background fetch intermittently causes realm to fail to initialize and crash app at try! - SOLVED
This is like a drop-in replacement for realms example swift project enabling encryption using the function getKey().
https://github.com/realm/realm-cocoa/blob/master/examples/ios/swift/Encryption/ViewController.swift
The following swift function is a drop in replacement, it documents the painful experience of an issue
which has been unsolved for years till crashlytics revealed a very useful hint, which lead to the root cause
and fix.
Comments included for education on what the symptoms were, the cause and fix and other notes.
@danielt1263
danielt1263 / RetryingTokenNetworkService.swift
Last active June 12, 2023 14:54
The TokenAcquisitionService automatically retry requests if it receives an unauthorized error. Complete with proof that it works correctly.
//
// TokenAcquisitionService.swift
//
// Created by Daniel Tartaglia on 16 Jan 2019.
// Copyright © 2022 Daniel Tartaglia. MIT License.
//
import Foundation
import RxSwift
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active June 29, 2024 10:22
crack activate Office on mac with license file
@simme
simme / UITabBarController+ToggleTabBar.swift
Created January 25, 2018 15:36
Extension on UITabBarController for hiding/showing the tab bar.
extension UITabBarController {
/**
Show or hide the tab bar.
- Parameter hidden: `true` if the bar should be hidden.
- Parameter animated: `true` if the action should be animated.
- Parameter transitionCoordinator: An optional `UIViewControllerTransitionCoordinator` to perform the animation
along side with. For example during a push on a `UINavigationController`.
*/