Skip to content

Instantly share code, notes, and snippets.

View diatrevolo's full-sized avatar
🔈

Roberto J. Osorio-Goenaga diatrevolo

🔈
View GitHub Profile
// GitHub Reference: https://github.com/lixing123/ExtAudioFileConverter
// LAME iOS Build: https://github.com/kewlbear/lame-ios-build
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
NS_ASSUME_NONNULL_BEGIN
enum BitDepth{
@diatrevolo
diatrevolo / command.sh
Created November 27, 2018 19:53
HLS pipelne
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! video/x-raw,width=640,height=480 ! hlssink max-files=1

Keybase proof

I hereby claim:

  • I am diatrevolo on github.
  • I am rawbirdtoe (https://keybase.io/rawbirdtoe) on keybase.
  • I have a public key ASDro7peExX8hopk1GElxMsLPmlj45e1lbfK0FvVpMBgeQo

To claim this, I am signing this object:

@diatrevolo
diatrevolo / DeviceUID.m
Last active March 10, 2016 20:20 — forked from miguelcma/DeviceUID.m
iOS Unique Device ID that persists between app reinstalls
/* DeviceUID.h
#import <Foundation/Foundation.h>
@interface DeviceUID : NSObject
+ (NSString *)uid;
@end
*/
// Device.m
func testGetItems_withIncorrectArray() {
client = MyRESTClient(url: NSURL(string: "http://notRight")!, manager: manager!)
let expectation = expectationWithDescription("GetJSONArray")
var itemsArray: [MyItem]?
client?.getAvailableItems { (items) -> () in
itemsArray = items
expectation.fulfill()
}
waitForExpectationsWithTimeout(5) { (error: NSError?) -> Void in
func testGetItems_withNil() {
client = MyRESTClient(url: NSURL(string: "http://nil")!, manager: manager!)
let expectation = expectationWithDescription("GetJSONArray")
var itemsArray: [MyItem]?
client?.getAvailableItems { (items) -> () in
itemsArray = items
expectation.fulfill()
}
waitForExpectationsWithTimeout(5) { (error: NSError?) -> Void in
XCTAssert(itemsArray == nil, "Array should be nil when no items are found")
func testGetItems_withArray() {
client = MyRESTClient(url: NSURL(string: "http://notNil")!, manager: manager!)
let expectation = expectationWithDescription("GetJSONArray")
var itemsArray: [MyItem]?
client?.getAvailableItems { (items) -> () in
itemsArray = items
expectation.fulfill()
}
waitForExpectationsWithTimeout(5) { (error: NSError?) -> Void in
import Foundation
import Alamofire
struct MyRESTClient {
let url: NSURL
let manager: Manager
init(url: NSURL, manager: Manager?) {
self.url = url
import XCTest
import Alamofire
class MyRESTClientTests: XCTestCase {
var client: MyRESTClient?
var manager: Alamofire.Manager?
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.