This file contains 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
function foo() { | |
console.log("foo - start") | |
$("button.search-button").click() | |
setTimeout(function() { | |
var li = $(".list-item")[0] | |
var delButton = $(li).find("button.js-activity-delete") | |
var confirmDelButton = $(li).find("button.delete-yes") | |
console.log(delButton, confirmDelButton) |
This file contains 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
func sortConvex(input: [CLLocationCoordinate2D]) -> [CLLocationCoordinate2D] { | |
// X = longitude | |
// Y = latitudeß | |
// 2D cross product of OA and OB vectors, i.e. z-component of their 3D cross product. | |
// Returns a positive value, if OAB makes a counter-clockwise turn, | |
// negative for clockwise turn, and zero if the points are collinear. | |
func cross(P: CLLocationCoordinate2D, A: CLLocationCoordinate2D, B: CLLocationCoordinate2D) -> Double { | |
let part1 = (A.longitude - P.longitude) * (B.latitude - P.latitude) |
This file contains 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 AVFoundation | |
import Foundation | |
// The maximum number of audio buffers in flight. Setting to two allows one | |
// buffer to be played while the next is being written. | |
private let kInFlightAudioBuffers: Int = 2 | |
// The number of audio samples per buffer. A lower value reduces latency for | |
// changes but requires more processing but increases the risk of being unable | |
// to fill the buffers in time. A setting of 1024 represents about 23ms of |
This file contains 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
- (BOOL)isSameDayWithDateOne:(NSDate *)dateOne dateTwo:(NSDate *)dateTwo{ | |
NSCalendar *calender = [NSCalendar currentCalendar]; | |
unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit; | |
NSDateComponents *compOne = [calender components:unitFlags fromDate:dateOne]; | |
NSDateComponents *compTwo = [calender components:unitFlags fromDate:dateTwo]; | |
return ([compOne day] == [compTwo day] && [compOne month] == [compTwo month] && [compOne year] == [compTwo year]); |