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
| console.Datastore getDatastore() { | |
| final ComputeOAuth2Console oauthClient = | |
| new ComputeOAuth2Console(Config.projectNumber); | |
| return new console.Datastore(oauthClient) | |
| ..makeAuthRequests = true; | |
| } |
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
| console.Datastore getDatastore() { | |
| final ComputeOAuth2Console oauthClient = | |
| new ComputeOAuth2Console(Config.projectNumber, | |
| privateKey : Config.privateKey, | |
| iss : Config.serviceEmail, | |
| scopes : Config.scopes); | |
| return new console.Datastore(oauthClient) | |
| ..makeAuthRequests = true; | |
| } |
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
| library configuration; | |
| import 'dart:io'; | |
| import 'package:google_datastore_v1beta2_api/datastore_v1beta2_api_console.dart'; | |
| class Config { | |
| static String get privateKey => new File('privatekey.pem').readAsStringSync(); | |
| static const String projectId = 'project-id'; | |
| static const String projectNumber = 'project-number'; |
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
| final Map<String, client.Property> person = | |
| {'name' : new client.Property.fromJson({'stringValue' : 'Thomas Løcke'}), | |
| 'website' : new client.Property.fromJson({'stringValue' : 'http://google.com/+ThomasLøcke'}), | |
| 'timestamp' : new client.Property.fromJson({'dateTimeValue' : timestamp})}; |
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
| $ openssl pkcs12 -in <P12 key> -nocerts -passin pass:notasecret -nodes -out <PEM key> |
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
| import 'dart:convert'; | |
| import 'configuration.dart'; | |
| import 'package:google_oauth2_client/google_oauth2_console.dart'; | |
| import 'package:google_datastore_v1beta2_api/datastore_v1beta2_api_client.dart' as client; | |
| import 'package:google_datastore_v1beta2_api/datastore_v1beta2_api_console.dart' as console; | |
| /** | |
| * Search for args[0] ID in datastore. Add new entity if search fails to locate |
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
| Future getTag() { | |
| final Completer c = new Completer(); | |
| final HttpClient client = new HttpClient(); | |
| client.getUrl(Uri.parse(tagUrl)) | |
| .then((HttpClientRequest request) { | |
| return request.close(); | |
| }) | |
| .catchError((e) { | |
| // If the tagUrl server is down, we catch and log it here. |
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
| // Add google_drive_v2_api to pubspec.yaml | |
| import "package:google_oauth2_client/google_oauth2_console.dart" as oauth; | |
| import "package:google_drive_v2_api/drive_v2_api_console.dart" as drivelib; | |
| const _IDENTIFIER = "<YOUR CLIENT ID>"; | |
| const _SECRET = "<YOUR CLIENT SECRET>"; | |
| const _SCOPES = const ["https://www.googleapis.com/auth/drive.file"]; | |
| void main() { |
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
| import 'dart:async'; | |
| import 'dart:io'; | |
| import 'package:route/server.dart'; | |
| import 'package:route/url_pattern.dart'; | |
| final Map<String, UrlPattern> Urls = {'/' : new UrlPattern('/'), | |
| 'ninja' : new UrlPattern('/ninja'), | |
| 'pirate' : new UrlPattern('/pirate'), | |
| 'samurai' : new UrlPattern('/samurai')}; |
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 Hello_World_Template | |
| (Request : in AWS.Status.Data) | |
| return AWS.Response.Data | |
| is (AWS.Response.File (AWS.MIME.Text_Plain, | |
| "templates/hello_world.tmpl")); |