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 java.lang.management.*; | |
| import java.util.List; | |
| public class JavaEnvironment { | |
| public static void main(String args[]) { | |
| System.out.println( | |
| "Number of available processors: " + Runtime.getRuntime().availableProcessors()); | |
| System.out.println("GCs:"); | |
| ManagementFactory |
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
| { | |
| "Version": "2008-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Allow", | |
| "Principal": { | |
| "AWS": [ | |
| "arn:aws:iam::<id1>:root", | |
| "arn:aws:iam::<id2>:root", | |
| "arn:aws:iam::<id3>:root" |
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
| Pipeline: | |
| Type: AWS::CodePipeline::Pipeline | |
| Properties: | |
| Name: !Ref 'AWS::StackName' | |
| RoleArn: !GetAtt CodePipelineServiceRole.Arn | |
| ArtifactStore: | |
| Type: S3 | |
| Location: !Ref ArtifactBucket | |
| Stages: | |
| - Name: Source |
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
| @Get('/download/:id') | |
| async downloadFile(@Param('id') id: string): Promise<FileResult> { | |
| await queryDbForFileOrSo(); | |
| // content type will be inferred or explicit specified | |
| return new FileResult(stream | buffer | string [, 'application/pdf' ]); | |
| // or | |
| return new StreamResult(stream); | |
| // or | |
| return new BufferedResult(buffer); |
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 { map } from 'mobx/lib/mobx'; | |
| interface Todo { | |
| id: string; | |
| name: string; | |
| active: boolean; | |
| } | |
| export class MyTodoStore { | |
| todos = map<Todo>(); |
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, { Component } from 'react'; | |
| import { observer } from 'mobx-react/index'; | |
| import { observable } from 'mobx/lib/mobx'; | |
| @observer | |
| export class Todo extends Component<{todoId: string}, {}> { | |
| @observable | |
| private todo: Todo; | |