This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @implementation AVAssetExportSession (Testing) | |
| - (void) exportSynchronously | |
| { | |
| dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); | |
| [self exportAsynchronouslyWithCompletionHandler:^{ | |
| dispatch_semaphore_signal(semaphore); | |
| }]; | |
| dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); | |
| dispatch_release(semaphore); |
Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution
I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "lifx" # http://www.rubydoc.info/gems/lifx | |
| def calculate_color(i) # 0 <= i <= 1 | |
| h = [40 * 2 * i, 40].min # will be 40 (yellow) at i=1/2 and stay there | |
| s = 1.0 - [(i - 0.5) * 2, 0].max # will be 1 until i=1/2 and then go down to 0 | |
| b = i | |
| LIFX::Color.hsbk(h, s, b, LIFX::Color::KELVIN_MIN) | |
| end | |
| duration = 10 * 60 # seconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| switch (indexPath.section, indexPath.row) { | |
| case (0, _): println("section 0") | |
| case (1, _): println("section 1") | |
| case (2, 0...2): println("section 2 0-2") | |
| case (2, 3...5): println("section 2 3-5") | |
| case (3, let row): println("\(row)") | |
| default: println("") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // AppleHomeKitUtilities.swift | |
| // AppleHomeKit | |
| // | |
| // Created by Ankit Thakur on 2/7/15. | |
| // Copyright (c) 2015 Ankit Thakur. All rights reserved. | |
| // | |
| import UIKit | |
| import HomeKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import QuartzCore | |
| extension CGFloat { | |
| func map(from from: ClosedInterval<CGFloat>, to: ClosedInterval<CGFloat>) -> CGFloat { | |
| let result = ((self - from.start) / (from.end - from.start)) * (to.end - to.start) + to.start | |
| return result | |
| } | |
| } | |
| extension Double { |

