Skip to content

Instantly share code, notes, and snippets.

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

noppe noppefoxwolf

🦊
きつねかわいい!!!
View GitHub Profile
//
// CallStackReporter.swift
// DramaticCrash
//
// Copyright (c) 2018 Hironori Ichimiya <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
%{
number_of_generated = 5
}%
public struct PrefixedArray<Element, RestElements> {
public let prefix: Element
public let rest: RestElements
@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
//

slidenumber: true autoscale: true

iOS13とmacOS CatalinaのWebSocketサポート

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

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

@omochimetaru


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 {
@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" }
},
@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()
}
@hossamghareeb
hossamghareeb / AppDelegate.swift
Created January 3, 2021 11:10
Bypassing AppDelegate and Scene delegate for Unit testing in iOS
Remove @main or @UIApplicationMain
@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);
@wakinchan
wakinchan / generate-target-dependencies.sh
Last active July 13, 2025 14:04
Generate Target Dependencies for Package.swift
#!/usr/bin/env sh
# usage: sh ./generate-target-dependencies.sh | dot -Tsvg -o target-graph.svg
packages=`swift package describe --type json`
targets=`echo $packages | jq '.targets'`
target_names=`echo $targets | jq -r '.[] | .name'`
body=""
template=`cat <<EOF
digraph DependenciesGraph {