Skip to content

Instantly share code, notes, and snippets.

View yutailang0119's full-sized avatar

Yutaro Muta yutailang0119

View GitHub Profile
@tarunon
tarunon / Image.swift
Created October 4, 2018 06:48
How to solve Bundle things in microframeworks
public struct BundleReference<T: NSObjectProtocol> {
static var _bundle: Bundle {
return Bundle(for: T.self)
}
}
public protocol BundleReferencable {
associatedtype Referenced: NSObjectProtocol
static var bundle: BundleReference<Referenced>.Type { get }
@lattner
lattner / async_swift_proposal.md
Last active December 28, 2024 11:11 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@ukitaka
ukitaka / convert_to_srgb.md
Created February 9, 2017 10:13
Storyboardとxibのcolor spaceをsRGBに統一する

calibratedRGB → sRGB

% find . -name "*.storyboard" | xargs sed -i "" '-e s/colorSpace="calibratedRGB"/colorSpace="custom" customColorSpace="sRGB"/g'
% find . -name "*.xib" | xargs sed -i "" '-e s/colorSpace="calibratedRGB"/colorSpace="custom" customColorSpace="sRGB"/g'

calibratedWhite → sRGB

@dealforest
dealforest / slack.py
Last active January 24, 2018 01:53
send to slack in LLDB
#!/usr/bin/env python
import lldb
def slack(debugger, command, result, internal_dict):
frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
path = command
lldb.debugger.HandleCommand("""
expr -l swift --
@mono0926
mono0926 / commit_message_example.md
Last active February 11, 2025 06:39
[転載] gitにおけるコミットログ/メッセージ例文集100
@kawanet
kawanet / NSURL+dictionaryFromQueryString.h
Last active December 23, 2015 15:49 — forked from halsk/NSURL+dictionaryFromQueryString.h
val にも = が入っていたり、key/val に + があった場合に対応してみました。 val が不正で stringByReplacingPercentEscapesUsingEncoding が例外を出す場合もあるけど未対応。
#import <Foundation/Foundation.h>
@interface NSURL (dictionaryFromQueryString)
-(NSDictionary *) dictionaryFromQueryString;
@end
@shinyaohira
shinyaohira / App States and Multitasking.md
Last active October 5, 2023 07:57
アプリケーションの状態とマルチタスキング

全体的に簡略化し、必要と思われる部分を抜粋しました。

  • Not running

    アプリは起動されていないか、実行されていたけれどもシステムによって終了されています。

  • Inactive