Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| // | |
| // PSPDFThreadSafeMutableDictionary.m | |
| // | |
| // Copyright (c) 2013 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| // | |
| // CLLocation+Sino.h | |
| // | |
| // Created by [email protected] on 13-4-26. | |
| // 火星坐标系转换扩展 | |
| // | |
| // earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换 | |
| // 未包含 mars2earth. 需要这个可参考 http://xcodev.com/131.html | |
| #import <CoreLocation/CoreLocation.h> |
| // Yeah, global variables suck, but it's kind of a necessary evil here | |
| AudioUnit *audioUnit = NULL; | |
| float *convertedSampleBuffer = NULL; | |
| int initAudioSession() { | |
| audioUnit = (AudioUnit*)malloc(sizeof(AudioUnit)); | |
| if(AudioSessionInitialize(NULL, NULL, NULL, NULL) != noErr) { | |
| return 1; | |
| } |
| @implementation NSURLConnection (Timeout) | |
| + (dispatch_queue_t)timeoutLockQueue { | |
| static dispatch_queue_t queue; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| queue = dispatch_queue_create("timeout lock queue", DISPATCH_QUEUE_SERIAL); | |
| }); | |
| return queue; | |
| } |
| /* | |
| Original comments from Apple: | |
| File: MixerHostAudio.m | |
| Abstract: Audio object: Handles all audio tasks for the application. | |
| Version: 1.0 | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| MKMapRect zoomRect = MKMapRectNull; | |
| for (id <MKAnnotation> annotation in mapView.annotations) { | |
| MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); | |
| MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0); | |
| if (MKMapRectIsNull(zoomRect)) { | |
| zoomRect = pointRect; | |
| } else { | |
| zoomRect = MKMapRectUnion(zoomRect, pointRect); | |
| } | |
| } |