Skip to content

Instantly share code, notes, and snippets.

View kingcos's full-sized avatar
📲
Busy for work.

kingcos kingcos

📲
Busy for work.
View GitHub Profile
@mecid
mecid / Calendar.swift
Last active May 5, 2024 08:43
SwiftUI Calendar view using LazyVGrid
import SwiftUI
extension Calendar {
func generateDates(
inside interval: DateInterval,
matching components: DateComponents
) -> [Date] {
var dates: [Date] = []
dates.append(interval.start)
@Lancewer
Lancewer / CollectionViewCell.swift
Last active May 17, 2023 09:05
[Collection Single Selection] single selection in UICollectionView with swift #swift #UICollectionView #selection #select #single select
//custom cell class
import UIKit
class CollectionViewCell: UICollectionViewCell {
@IBOutlet weak var nameLabel: UILabel!
override var isSelected: Bool{
didSet(newValue){
contentView.backgroundColor = newValue ? UIColor.green : UIColor.white
@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.

@matheusagcosta
matheusagcosta / podbot.md
Last active December 25, 2022 11:58
Podbot Counter Strike 1.6 on Mac OSX

1 - Make sure you have Counter Strike installed

2 - Download YAPB http://forums.bots-united.com/showthread.php?t=9986

3 - Extract the zip and move the folder addons with all the content to ~/Library/Application Support/Steam/steamapps/common/Half-Life/cstrike

4 - After that, open the file liblist.gam in the folder above and replace gamedll_osx "dlls/cs.dylib" with this content:

//gamedll_osx "dlls/cs.dylib"
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR