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
//let cloudStorage : BusinessCloudStorageProtocol = Backblaze.init(accountID: "[account_id]", appKey: "[app_key]") | |
//let cloudStorage : BusinessCloudStorageProtocol = Rackspace.init(username: "[username]", apiKey: "[api_key]", region: "[region]") | |
//let cloudStorage : BusinessCloudStorageProtocol = MicrosoftAzure.init(accountName: "[account_name]", accessKey: "access_key") | |
let cloudStorage : BusinessCloudStorageProtocol = AmazonS3.init(accessKeyId: "[access_key]", secretAccessKey: "[secret_key]", region: "[region]") | |
let bucket : CRBucket = CRBucket.init() | |
bucket.name = "[bucketName]"; | |
bucket.identifier = "[identifier]" | |
let path = Bundle.main.path(forResource: "UserData", ofType: "csv")! |
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
#TODO: check OS and use YUM, APT, OR BREW | |
#ohmyzsh | |
sudo apt-get install zsh | |
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
sudo apt-get install httpie # awesome alternative to curl |
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
+(NSData*) dataWithInputStream:(NSInputStream*) stream { | |
NSMutableData * data = [NSMutableData data]; | |
[stream open]; | |
NSInteger result; | |
uint8_t buffer[1024]; // BUFFER_LEN can be any positive integer | |
while((result = [stream read:buffer maxLength:1024]) != 0) { | |
if(result > 0) { | |
// buffer contains result bytes of data to be handled |
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
extension Data { | |
init(reading input: InputStream) { | |
self.init() | |
input.open() | |
let bufferSize = 1024 | |
let buffer = UnsafeMutablePointer<UInt8>.allocate(capacity: bufferSize) | |
while input.hasBytesAvailable { | |
let read = input.read(buffer, maxLength: bufferSize) |
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
git filter-branch --env-filter \ | |
'if [ $GIT_COMMIT = <COMMIT_HASH> ] | |
then | |
export GIT_AUTHOR_DATE=“Mon Jun 19 21:20:50 2017 -0300" | |
export GIT_COMMITTER_DATE="<CHANGE DATE ON THE FORMAT ABOVE>" | |
fi' -f |
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
echo "Target architectures: $ARCHS" | |
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" | |
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK | |
do | |
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) | |
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" | |
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" | |
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH") |
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
-(void)viewDidAppear:(BOOL)animated{ | |
self.box = [[CRBox alloc] initWithClientId:@"" clientSecret:@""]; | |
NSString * restored_state = [NSUserDefaults.standardUserDefaults objectForKey:@"box_state"]; | |
if (restored_state != nil ) { | |
[self.box loadAsString:restored_state]; | |
NSString * userName = [self.box userName]; | |
NSString * userLogin = [self.box userLogin]; | |
NSLog(@"%@ - %@", userName, userLogin); |
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
["airport", | |
"atm", | |
"amusement_park", | |
"aquarium", | |
"art_gallery", | |
"bakery", | |
"bank", | |
"bar", | |
"beauty_salon", | |
"bicycle_store", |
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
// SwiftViewController.swift | |
// PrototypeApplication | |
// | |
// Created by Felipe César Silveira de Assis on 12/12/17. | |
// Copyright © 2017 CloudRail. All rights reserved. | |
// | |
import UIKit | |
import CloudrailSI |
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
// SwiftViewController.swift | |
// PrototypeApplication | |
// | |
// Created by Felipe César Silveira de Assis on 12/12/17. | |
// Copyright © 2017 CloudRail. All rights reserved. | |
// | |
import UIKit | |
import CloudrailSI |