Skip to content

Instantly share code, notes, and snippets.

View yxztj's full-sized avatar
🎯
Focusing

Jason Yu yxztj

🎯
Focusing
  • Facebook
  • Menlo Park
View GitHub Profile
@yxztj
yxztj / TaskConcurrencyManifesto.md
Last active March 1, 2024 07:01 — forked from lattner/TaskConcurrencyManifesto.md
Swift Concurrency Manifesto 中文翻译
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 7, 2024 09:05
Swift Concurrency Manifesto
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — 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.

@Arthraim
Arthraim / hairline.m
Last active October 29, 2018 07:40
Hairline of iOS
/**
* Width of hairline (1px on real device screen)
* The dppx of screens can be found here http://dpi.lv/
*
* @return CGFloat number to be set for "1px"
*/
+ (CGFloat)hairLineWidth {
if ([UIScreen mainScreen].bounds.size.width == 414.f) { // Plus
return 1.f / 2.46f; // 2.46 is the dppx of plus screens
} else {
@wong2
wong2 / tantan.py
Created February 18, 2016 16:37
自动like探探上的所有人
#-*-coding:utf-8-*-
import hashlib
import hmac
import time
import requests
HMAC_KEY = '5tT!TQkf5fYbabw5?KL2659XgL^JgxWw8r9Y+bAvGwP-QfteQL'
class TanTan(object):
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos