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
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "github.com/dghubble/sling" | |
| ) | |
| func 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
| # Postgres Docker creates a volume by default so we only need the following parameters | |
| docker run -e POSTGRES_USER=<dbuser> -e POSTGRES_PASSWORD=<dbpassword> -e POSTGRES_DB=<dbname> -p 5432:5432 --name <dbname> -d postgres |
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
| export interface Repository { | |
| beginTransaction: () => Promise<Transaction>; | |
| } |
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
| const poll = async (fn: any, timeout: number, interval: number) => { | |
| const endTime = Date.now() + timeout; | |
| const checkCondition = async (resolve: any, reject: any) => { | |
| const result = await fn(); | |
| if (result) { | |
| resolve(result); | |
| } else if (Date.now() < endTime) { | |
| setTimeout(checkCondition, interval, resolve, reject); | |
| } else { |
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
| package main | |
| import ( | |
| "fmt" | |
| "strconv" | |
| "github.com/aws/aws-sdk-go/aws" | |
| "github.com/aws/aws-sdk-go/aws/session" | |
| "github.com/aws/aws-sdk-go/service/dynamodb" | |
| "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" |
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
| ################################################################################################### | |
| #### Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| #### | |
| #### Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file | |
| #### except in compliance with the License. A copy of the License is located at | |
| #### | |
| #### http://aws.amazon.com/apache2.0/ | |
| #### | |
| #### or in the "license" file accompanying this file. This file is distributed on an "AS IS" | |
| #### BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
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 IAppBuilder ConfigureSerilog(this IAppBuilder app, HttpConfiguration config) | |
| { | |
| config.Services.Add(typeof(IExceptionLogger), new SerilogExceptionLogger()); | |
| var assembly = typeof(SerilogConfig).Assembly.GetName(); | |
| var configurationProvider = new ConfigurationProvider(AppSettingKey.Prefix); | |
| var logEventLevel = configurationProvider.Get(AppSettingKey.SerilogLoggingLevel, LogEventLevel.Error); | |
| const string logFileName = "talentsearch-api.json"; | |
| var logFilePath = Path.Combine(configurationProvider.Get(AppSettingKey.SerilogFilePath), logFileName); |
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 React from 'react'; | |
| import { Avatar } from 'antd'; | |
| import { shallow, ShallowWrapper } from 'enzyme'; | |
| import ColourAvatar from './ColourAvatar'; | |
| describe('ColourAvatar', () => { | |
| let wrapper: ShallowWrapper; | |
| const defaultProps: any = { |
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
| { | |
| "diff": true, | |
| "extension": ["ts", "js"], | |
| "package": "./package.json", | |
| "reporter": "spec", | |
| "slow": 75, | |
| "timeout": 2000, | |
| "watch-files": ["src/**/*.js", "src/**/*.ts"], | |
| "watch-extensions": ["ts", "js"], | |
| "require": ["ts-node/register"] |
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 * as dateService from './dateService'; | |
| const nowMock = dateService.now as jest.MockedFunction<typeof dateService.now>; | |
| describe('some service', () => { | |
| const mockNow = 'now'; | |
| beforeEach(() => { | |
| nowMock.mockReturnedValue(mockNow); | |
| }); |