Skip to content

Instantly share code, notes, and snippets.

View allending's full-sized avatar

Allen Ding allending

View GitHub Profile
@allending
allending / NKTTextViewTokenizer.h
Created February 1, 2011 08:07
Some expository code from Notekata as a UITextInputTokenizer example
//Copyright (c) 2010, Allen Ding
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions are met:
//
//1. Redistributions of source code must retain the above copyright notice, this
//list of conditions and the following disclaimer.
//
//Copyright (c) 2010, Allen Ding
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions are met:
//
//1. Redistributions of source code must retain the above copyright notice, this
//list of conditions and the following disclaimer.
//
//2. Redistributions in binary form must reproduce the above copyright notice,
*.DS_Store
# Build directory
build/
# XCode user specific files
*.mode1v3
*.mode2v3
*.perspectivev3
*.pbxuser
- (void)testBlock {
NSMutableArray *array = [[NSMutableArray alloc] initWithObjects:@"foo", @"bar", nil];
void(^block)(void) = ^{
// probably dies in here
[array addObject:@"bomb"];
[array removeObject:@"bomb"];
};
// block retains array?
$ du -h -d 1 .
24K ./bindings
76K ./cmake
3.9G ./Debug+Asserts
76K ./docs
4.0K ./examples
2.4M ./include
1.2G ./lib
4.0K ./projects
12K ./test
//: Playground - noun: a place where people can play
import UIKit
// - Equatable has a Self requirement, so Value has a Self requirement
// - So you couldn't use it as a type anyway:
//
// e.g. let myValue : Value = ... // doesn't work
//
// - The problem comes from requiring Value to be Equatable. In this case,
import Foundation
extension SequenceType {
func each(@noescape block: (element: Self.Generator.Element) -> Void) {
for item in self {
block(element: item)
}
}
func eachWithIndex(@noescape block: (Int, Self.Generator.Element) -> Void) {
lembacon
Aug 5, 2015 5:04 AM
(in response to daltheman)
Hi guys, I've just found a temporary workaround. (Applies to Xcode 7 beta 4 on OS X El Capitan Developer Beta 6)
Open your Terminal:
cd /Applications/Xcode-beta.app (or wherever your Xcode 7 beta 4 is located)
cd Contents/Developer/Platforms/iPhoneSimulator.platform
cd Developer/SDKs/iPhoneSimulator.sdk/usr/lib
sudo mv dyld_sim dyld_sim.orig
[
{
"resourceId": 31758,
"title": "Up The Ante - Kopitiam Talk #5: Managing 20 over investors",
"link": "http://www.bfm.my/31758.html",
"description": "<p>Starting up a restaurant usually begins with a few partners and a small sum of capital. But this week&rsquo;s Kopitiam Talk we have two outlets that crowdfunded their outlets and today, they have to manage over 20 investors. How are they managing their expectations as well as their cashflow? TC Hui from Ticklish Ribs &amp; Wiches and Hwa Yang Jerng from Sudobrew tell us more.</p>",
"encoding": "audio/mpeg",
"programId": 240,
"downloadLink": "http://open-for-business.s3.amazonaws.com/2016.04.04-OFB-UTA-Kopitiam5-ManagingInvestor-Sudobrew-TicklishRibs.mp3",
"highlightImage": "http://www.bfm.my/assets/images/Enterprise/Open-For-Business/koptiamtalk.jpg",