For ease of maintainability this project has moved from this gist to its own repository. You can go and visit it there.
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: teal; icon-glyph: magic; | |
// To use, add a parameter to the widget with a format of: image.png|padding-top|text-color|ture for online server image or false to load local image|Image filers eg: nature,blur | |
// The image should be placed in the iCloud Scriptable folder (case-sensitive). | |
// The padding-top spacing parameter moves the text down by a set amount. | |
// The text color parameter should be a hex value. | |
// For example, to use the image bkg_fall.PNG with a padding of 40 and a text color of red, | |
// the parameter should be typed as: bkg_fall.png|40|#ff0000|true|nature |
The attached lldb command pblock
command lets you peek inside an Objective-C block. It tries to tell you where to find the source code for the block, and the values captured by the block when it was created.
Consider this example program:
#import <Foundation/Foundation.h>
@interface Foo: NSObject
@end
@implementation Foo
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
Author: Chris Lattner
// | |
// DON'T do this, or else you risk a deadlock (e.g., by accidentally performing it in a different order somewhere) | |
// | |
dispatch_async(firstQueue, ^{ | |
dispatch_sync(secondQueue, ^{ | |
// code requiring both queues | |
}); | |
}); |
// | |
// Results+Rx.swift | |
// | |
// Make Realm auto-updating Results observable. Works with Realm 0.98 and later, RxSwift 2.1.0 and later. | |
// | |
// Created by Florent Pillet on 12/02/16. | |
// Copyright (c) 2016 Florent Pillet. All rights reserved. | |
// | |
import Foundation |
'use strict'; | |
import React, { | |
AppRegistry, | |
Component, | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity, | |
LayoutAnimation, | |
} from 'react-native'; |