public AmazonCognitoIdentityProviderClient CreateFromKeys()
{
var creds = new BasicAWSCredentials("ACCESS_KEY", "SECRET_KEY");
return new AmazonCognitoIdentityProviderClient(creds, RegionEndpoint.USEast1);
}
public AmazonCognitoIdentityProviderClient CreateFromProfile()
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 sleep(millis) { | |
| var start = new Date().getTime(); | |
| while ((new Date().getTime() - start) <= millis) {} | |
| } |
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 { createLogger, format, transports } from 'winston' | |
| const { combine, timestamp, label, printf } = format; | |
| const myFormat = printf(info => { | |
| return `${info.timestamp} [${info.label}] ${info.level} - ${info.message}`; | |
| }); | |
| module.exports = function(fileName) { | |
| return createLogger({ | |
| format: combine( |
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
| this.dataProvider.get().subscribe( | |
| async next => { | |
| let document = {...} | |
| const response = await this.es.index(document) | |
| }, | |
| error => { reject(error) }, | |
| () => { resolve(this.stats.indexCount) }) |
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
| ``` | |
| return AppDomain.CurrentDomain.GetAssemblies() | |
| .SelectMany(s => s.GetTypes()) | |
| .Where(type => typeof(<the_interface>).IsAssignableFrom(type)) | |
| ``` |
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
| using System; | |
| using Newtonsoft.Json; | |
| using System.Reactive.Linq; | |
| using Nito.AsyncEx; | |
| using System.Threading.Tasks; | |
| using System.Collections.Generic; | |
| using System.Threading; | |
| using System.Reactive.Threading.Tasks; | |
| namespace Playground |
\dt- Shows the tables in the database\d+ table_name- Shows the tables schemadrop table table_name;- Drops the table named table_name from the database
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 static class MethodTimeLogger | |
| { | |
| public static void Log(MethodBase methodBase, long milliseconds) | |
| { | |
| } | |
| } | |
| class Program | |
| { | |
| [Time] |
- Request a github oauth token
curl -v -X POST \
-H "Authorization: token YOUR_OAUTH_TOKEN_REQUESTED_IN_STEP_1" \
-H "Content-Type: application/json" \
-d '{"description": "testcreategist", "public":false, "files":{"file1.txt":{"content":"some content..."}}}' \
https://api.github.com/gists For Visual Studio 2015, Open a command line window here
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\VisualStudioIntegration\Tools\Bin
and execute the following
CreateExpInstance.exe /Reset /VSInstance=14.0 /RootSuffix=Exp && PAUSENewerOlder