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
| function generateOAuthSignature(method, url, data){ | |
| var index = url.indexOf('?'); | |
| if (index > 0) | |
| url = url.substring(0, url.indexOf('?')); | |
| var signingToken = encodeURIComponent('uqZLVntpcEqx1nJ3xNkOzZIcKifKk7053WcZG8n5s') + "&" + encodeURIComponent('naVCZRp7I0gquIVHYyeHlmUPD9ASYVg9bXjhGRa11E'); | |
| //encodeURIComponent('Your Consumer Secret') + "&" + encodeURIComponent('Your Access Token Secret'); | |
| var keys = []; | |
| for (var d in data){ | |
| if (d != 'oauth_signature') { | |
| console.log('data: ' , d); |
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
| private class MyServiceFilter implements ServiceFilter { | |
| @Override | |
| public void handleRequest(final ServiceFilterRequest request, final NextServiceFilterCallback nextServiceFilterCallback, | |
| final ServiceFilterResponseCallback responseCallback) { | |
| nextServiceFilterCallback.onNext(request, new ServiceFilterResponseCallback() { | |
| @Override | |
| public void onResponse(ServiceFilterResponse response, Exception exception) { | |
| if (exception != null) { |
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)viewDidLoad { | |
| [super viewDidLoad]; | |
| self.authService = [AuthService getInstance]; | |
| if (self.authService.client.currentUser.userId) { | |
| [self performSegueWithIdentifier:@"loggedInSegue" sender:nil]; | |
| } | |
| } |
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
| var crypto = require('crypto'); | |
| var iterations = 1000; | |
| var bytes = 32; | |
| var aud = "Custom"; | |
| var masterKey = "Your-Master-Key"; | |
| function insert(item, user, request) { | |
| var accounts = tables.getTable('accounts'); | |
| if (request.parameters.login) { | |
| // this is a login attempt |
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) popTest { | |
| UINavigationController *nav = (UINavigationController*) self.view.window.rootViewController; | |
| UIViewController *root = [nav.viewControllers objectAtIndex:0]; | |
| [root performSelector:@selector(returnToRoot)]; | |
| } |
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
| public void addContainer(String containerName, boolean isPublic) { | |
| //Creating a json object with the container name | |
| JsonObject newContainer = new JsonObject(); | |
| newContainer.addProperty("containerName", containerName); | |
| //Passing over the public flag as a parameter | |
| List<Pair<String,String>> parameters = new ArrayList<Pair<String, String>>(); | |
| parameters.add(new Pair<String, String>("isPublic", isPublic ? "1" : "0")); | |
| mTableContainers.insert(newContainer, parameters, new TableJsonOperationCallback() { | |
| @Override | |
| public void onCompleted(JsonObject jsonObject, Exception exception, |
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) createContainer:(NSString *)containerName withPublicSetting:(BOOL)isPublic withCompletion:(CompletionBlock) completion { | |
| NSDictionary *item = @{ @"containerName" : containerName }; | |
| NSDictionary *params = @{ @"isPublic" : [NSNumber numberWithBool:isPublic] }; | |
| [self.containersTable insert:item parameters:params completion:^(NSDictionary *result, NSError *error) { | |
| [self logErrorIfNotNil:error]; | |
| NSLog(@"Results: %@", result); | |
| // Let the caller know that we finished | |
| completion(); | |
| }]; | |
| } |
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
| var azure = require('azure'); | |
| function del(id, user, request) { | |
| var accountName = 'accountname'; | |
| var accountKey = 'accountkey'; | |
| var host = accountName + '.blob.core.windows.net'; | |
| var blobService = azure.createBlobService(accountName, accountKey, host); | |
| blobService.deleteBlob(request.parameters.containerName, |
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
| var azure = require('azure'); | |
| function del(id, user, request) { | |
| var accountName = 'accountname'; | |
| var accountKey = 'accountkey'; | |
| var host = accountName + '.table.core.windows.net'; | |
| var tableService = azure.createTableService(accountName, accountKey, host); | |
| tableService.deleteEntity(request.parameters.tableName, |
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
| public void insertFeedback(Feedback feedback, TableOperationCallback<Feedback> callback) { | |
| mFeedbackTable.insert(feedback, callback); | |
| } |