Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.
Edit Xcode Scheme and add a pre-action script.
Copy the contents of preaction.sh
into the pre-action script box.
/** | |
Protocolo responsável por fazer o efeito de parallax nas imagens que, principalmente, são usadas como background. | |
É necessário chamar a função `setupParallaxInitialValues` no `awakeFromNib` da `UITableViewCell` para configurar os valores iniciais das variáveis. | |
Além disso, para total funcionamento do efeito, é necessário implementar algumas chamadas na `UIViewController` ou `UITableViewController` que a `tableView` está instanciada. | |
Chamar a função `setParallaxCellImageOffsetWithTableView` no `willDisplayCell` da `UITableViewDelegate` e para todas as células visíveis no método `scrollViewDidScroll`. | |
Implementação: |
// | |
// Created by Chris Wagner | |
// https://gist.github.com/cwagdev/e66d4806c1f63fe9387a | |
// | |
// Modified by Thiago Holanda (August/2016) | |
// | |
// These modifications was made to support the latest version of Swift | |
// before the major version (3.0) is released. This code will compile | |
// without any problem on Swift 2.2. | |
// |
Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.
Edit Xcode Scheme and add a pre-action script.
Copy the contents of preaction.sh
into the pre-action script box.
# Note: You MUST have curl 7.47+ with http/2 support compiled in | |
curl -v \ | |
-d '{"aps":{"alert":"<message>","badge":42}}' \ | |
-H "apns-topic: <bundle id>" \ | |
-H "apns-priority: 10" \ | |
--http2 \ | |
--cert <certificate file> \ | |
https://api.development.push.apple.com/3/device/<device token> |
# create an account, create an app | |
# @see https://apps.twitter.com/ | |
# retrieve the access tokens | |
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token | |
# create the file ~/twitter_api | |
nano ~/twitter_api | |
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0" |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
Byobu Commands | |
============== | |
byobu Screen manager | |
Level 0 Commands (Quick Start) | |
------------------------------ | |
<F2> Create a new window |
import XCTest | |
class NotificationTestCase: XCTestCase { | |
func testTriggerNotification() { | |
expectation(forNotification: .fooBar, | |
object: nil, | |
handler: nil) | |
let notificationCenter = NotificationCenter.default |
extension Sequence { | |
func groupSort(ascending: Bool = true, byDate dateKey: (Iterator.Element) -> Date) -> [[Iterator.Element]] { | |
var categories: [[Iterator.Element]] = [] | |
for element in self { | |
let key = dateKey(element) | |
guard let dayIndex = categories.index(where: { $0.contains(where: { Calendar.current.isDate(dateKey($0), inSameDayAs: key) }) }) else { | |
guard let nextIndex = categories.index(where: { $0.contains(where: { dateKey($0).compare(key) == (ascending ? .orderedDescending : .orderedAscending) }) }) else { | |
categories.append([element]) | |
continue | |
} |