Skip to content

Instantly share code, notes, and snippets.

View noppefoxwolf's full-sized avatar
🦊
きつねかわいい!!!

noppe noppefoxwolf

🦊
きつねかわいい!!!
View GitHub Profile
@samsonjs
samsonjs / ContentView.swift
Created July 2, 2024 21:22
How to fix a Swift 6 warning: "Sending main actor-isolated value of type 'WebAuthenticationSession' with later accesses to nonisolated context risks causing data races; this is an error in the Swift 6 language mode"
// https://iosdev.space/@andy/112714337582288785
import AuthenticationServices
import SwiftUI
struct ContentView: View {
@State var url = URL(string: "https://example.net")!
@Environment(\.webAuthenticationSession) var webAuthenticationSession
@DavidBuchanan314
DavidBuchanan314 / r1_api.md
Last active April 10, 2025 16:35
Rabbit R1 Unofficial API Docs

The Rabbit R1 uses a few custom APIs to talk to The Cloud™. Almost nothing happens on-device, and all the AI magic happens on servers.

Consequently, you don't really need the physical device.

TLS Client Fingerprinting

In lieu of an authentication scheme, Rabbit's servers attempt to verify device authenticity by checking the TLS client's JA3 fingerprint, presumably enforced by AWS WAF.

If your TLS client doesn't match an expected fingerprint, you'll get HTTP 403 errors. This fingerprint works:

@SmartJSONEditor
SmartJSONEditor / gist:33d796e81554205fd491b6449376c426
Last active March 31, 2024 05:38
Observation withObservationTracking as Combine publisher
import Combine
import Foundation
import Observation
// A: Using specific class
/// Class that wraps withObservationTracking function into a Combine compatible continuos stream publisher
public class ObservationTracker<O: Observable & AnyObject, T> {
/// Subscribe to a publisher.
public var valuePublisher: AnyPublisher<T, Never> {
@kumamotone
kumamotone / uhoho-i.dart
Created February 16, 2022 16:23
クレしんのホラー回って毎回怖い
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@hossamghareeb
hossamghareeb / AppDelegate.swift
Created January 3, 2021 11:10
Bypassing AppDelegate and Scene delegate for Unit testing in iOS
Remove @main or @UIApplicationMain
@jordansinger
jordansinger / iPod.swift
Created July 27, 2020 21:19
Swift Playgrounds iPod Classic
import SwiftUI
import PlaygroundSupport
struct iPod: View {
var body: some View {
VStack(spacing: 40) {
Screen()
ClickWheel()
Spacer()
}
@dbanksdesign
dbanksdesign / fontMap.json
Created September 12, 2019 18:12
iOS TextStyle Font Map
{
"PFToFontStyle": {
"0": { "value": "UICTFontTextStyleCaption1" },
"1": { "value": "UICTFontTextStyleSubhead" },
"2": { "value": "UICTFontTextStyleBody" },
"3": { "value": "UICTFontTextStyleTitle3" },
"4": { "value": "UICTFontTextStyleTitle2" },
"5": { "value": "UICTFontTextStyleTitle1" },
"6": { "value": "UICTFontTextStyleTitle0" }
},
import Foundation
public struct BSONError : LocalizedError, CustomStringConvertible {
public var message: String
public init(_ message: String) { self.message = message }
public var description: String { return message }
public var errorDescription: String? { description }
}
public enum BSONBinarySubtypes : UInt8 {

slidenumber: true autoscale: true

iOS13とmacOS CatalinaのWebSocketサポート

参加してなくてもついていけるもん!

WWDCゴリゴリキャッチアップ会 2019

@omochimetaru


@takasek
takasek / CodingKeyToSnake.swift
Last active August 5, 2020 06:08
CodingKeyをJSONのkeyに寄せて書くことができた!
// https://github.com/apple/swift/blob/b0f5815d2b003df628b1bcfe94681fec489c9492/stdlib/public/Darwin/Foundation/JSONEncoder.swift#L153
func _convertToSnakeCase(_ stringKey: String) -> String {
guard !stringKey.isEmpty else { return stringKey }
var words : [Range<String.Index>] = []
// The general idea of this algorithm is to split words on transition from lower to upper case, then on transition of >1 upper case characters to lowercase
//
// myProperty -> my_property
// myURLProperty -> my_url_property
//