Skip to content

Instantly share code, notes, and snippets.

View sasikiran's full-sized avatar

Sasi Kiran Malladi sasikiran

View GitHub Profile
import Cocoa
enum CoroutineState {
case Fresh, Running, Blocked, Canceled, Done
}
struct CoroutineCancellation: ErrorType {}
class CoroutineImpl<InputType, YieldType> {
let body: (yield: YieldType throws -> InputType) throws -> Void
import Foundation
// Add a typealias for the child type so different implementors can be specific about the types of their children.
protocol NodeRepresentedObject {
typealias Child
var children: [Child]? {get}
}
protocol EmailMessage: NodeRepresentedObject {
}
@mackuba
mackuba / wwdc15.md
Last active August 6, 2022 17:28
New stuff from WWDC 2015

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
@clementgenzmer
clementgenzmer / FBAnimationPerformanceTracker.h
Last active September 18, 2023 23:02
FBAnimationPerformanceTracker
/*
* This is an example provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
@vasarhelyia
vasarhelyia / brewMVVM.swift
Last active January 13, 2018 20:01
Brew MVVM
class Brew {
var temp: Float = 0.0
}
class BrewViewModel : NSObject {
var brew = Brew()
dynamic var temp: Float = 0.0 {
didSet {
self.brew.temp = temp
}
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active May 29, 2024 07:33
The best FRP iOS resources.

Videos

struct Regex {
let pattern: String
let options: NSRegularExpressionOptions!
private var matcher: NSRegularExpression {
return NSRegularExpression(pattern: self.pattern, options: self.options, error: nil)
}
init(pattern: String, options: NSRegularExpressionOptions = nil) {
self.pattern = pattern
@rsms
rsms / peertalk-multiple-devices-example.mm
Created July 16, 2014 00:20
Note that this is just an idea. This code might not even compile, and you'd want to observe PTChannel disconnects & errors to remove or reset the _devices dict.
@interface MyThing {
NSMutableDictionary* _devices;
// <NSNumber*deviceID>=<NSNull> while connecting
// <NSNumber*deviceID>=<PTChannel> while connected
}
- (void)startListeningForDevices {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserverForName:PTUSBDeviceDidAttachNotification object:PTUSBHub.sharedHub queue:nil usingBlock:^(NSNotification *note) {
@jpsim
jpsim / JAZMusician.h
Created July 7, 2014 09:25
SourceKit Playground
//
// JAZMusician.h
// JazzyApp
//
#import <Foundation/Foundation.h>
/**
JAZMusician models, you guessed it... Jazz Musicians!
From Ellington to Marsalis, this class has you covered.
@staltz
staltz / introrx.md
Last active May 29, 2024 05:51
The introduction to Reactive Programming you've been missing