Skip to content

Instantly share code, notes, and snippets.

View susieyy's full-sized avatar

yohei sugigami susieyy

View GitHub Profile
@paulmillr
paulmillr / active.md
Last active May 15, 2024 02:25
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@beader
beader / InfiniteTabView.swift
Last active March 20, 2024 15:06
Infinite Scrollable TabView using SwiftUI
//
// ContentView.swift
// InfinityTabView
//
// Created by beader on 2022/10/9.
//
import SwiftUI
struct ContentView: View {
@d-date
d-date / project.yml
Last active March 17, 2024 21:17
XcodeGen Example
name: XXXX
attributes:
LastUpgradeCheck: 1140
ORGANIZATIONNAME: "kankak, Inc."
options:
bundleIdPrefix: com.xxxx.xxxxxxxx
deploymentTarget:
iOS: 13.1.3
configs:
Develop Debug: debug
// Authoer: The SwiftUI Lab
// Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/
import SwiftUI
struct RefreshableScrollView<Content: View>: View {
@State private var previousScrollOffset: CGFloat = 0
@State private var scrollOffset: CGFloat = 0
@State private var frozen: Bool = false
@State private var rotation: Angle = .degrees(0)
@ikesyo
ikesyo / ScreenState.swift
Created September 3, 2023 16:13
ScreenState.swift
public enum ScreenState<Value, Error: Swift.Error> {
case loading
case failed(Error)
case empty
case loaded(Value)
public var isLoading: Bool {
if case .loading = self { return true }
return false
}
@SatoTakeshiX
SatoTakeshiX / convert.swift
Last active August 31, 2023 09:10
Take capture a view by SwiftUI
//
// ContentView.swift
// TryGeometryReader
//
// Created by satoutakeshi on 2019/12/07.
// Copyright © 2019 satoutakeshi. Licensed under MIT.
//
import SwiftUI
@natchiketa
natchiketa / a Super-simple Nginx reverse proxy with Homebrew on OS X.md
Last active May 18, 2023 04:54
Super-simple Nginx reverse proxy with Homebrew on OS X

Installation

1)

brew install nginx
sudo cp /usr/local/Cellar/nginx/1.8.0/homebrew.mxcl.nginx.plist /Library/LaunchAgents

2)

Replace /usr/local/etc/nginx/nginx.conf with the nginx.conf in this gist. I'm using port 5000 for my current project. Obviously, change server_name as well, and probably the name of its access log.

@oleganza
oleganza / async_swift_proposal.md
Last active May 12, 2023 10:06
Concrete proposal for async semantics in Swift

Async semantics proposal for Swift

Modern Cocoa development involves a lot of asynchronous programming using blocks and NSOperations. A lot of APIs are exposing blocks and they are more natural to write a lot of logic, so we'll only focus on block-based APIs.

Block-based APIs are hard to use when number of operations grows and dependencies between them become more complicated. In this paper I introduce asynchronous semantics and Promise type to Swift language (borrowing ideas from design of throw-try-catch and optionals). Functions can opt-in to become async, programmer can compose complex logic involving asynchronous operations while compiler produces necessary closures to implement that logic. This proposal does not propose new runtime model, nor "actors" or "coroutines".

Table of contents

@rpgreen
rpgreen / gist:c127aa4ebbcaa9026be7
Last active March 10, 2023 02:10
Swagger file demonstrating two ways to achieve HTTP redirects using API Gateway and Lambda
---
swagger: "2.0"
basePath: "/test"
schemes:
- "https"
paths:
/lambdaredirect-default:
get:
produces:
- "application/json"
@uhooi
uhooi / project.yml
Last active December 5, 2022 15:59
XcodeGen project spec sample
name: {Project Name}
options:
bundleIdPrefix: {Bundle ID Prefix}
deploymentTarget:
iOS: 13.0
xcodeVersion: "11.3.1" # 変わらない?
# findCarthageFrameworks: true # 余計なフレームワークまで追加されてしまうためコメントアウト
carthageExecutablePath: mint run Carthage/Carthage carthage