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 typescript from 'rollup-plugin-typescript2'; | |
| export default { | |
| input: 'src/index.js', | |
| output: { | |
| file: 'dist/app.js', | |
| format: 'umd', | |
| name: 'app', | |
| sourcemap: 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
| --- | |
| version: '3' | |
| services: | |
| go: | |
| image: 'golang:1.10-alpine' | |
| volumes: | |
| - './:/go/src/github.com/emmiep/hello/:ro' | |
| working_dir: '/go/src/github.com/emmiep/hello' | |
| command: ['go', 'run', 'main.go'] |
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
| FROM node:9.11-alpine as build | |
| WORKDIR /usr/app | |
| COPY ./package.json ./yarn.lock ./ | |
| RUN yarn | |
| COPY ./ ./ | |
| RUN yarn run build | |
| FROM nginx:1.14-alpine |
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
| http { | |
| server { | |
| listen 80; | |
| root /usr/share/nginx/html; | |
| location / { | |
| internal; | |
| } | |
| location ~ ^/(js/|img/|css/|favicon\.ico$) { |
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
| { | |
| "watch": [ | |
| "bin/", | |
| "lib/" | |
| ], | |
| "execMap": { | |
| "dart": "dart" | |
| }, | |
| "ext": "dart" | |
| } |
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 getUser(id) { | |
| if (users.has(id)) { | |
| return users.get(id); | |
| } | |
| } | |
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
| view({showProfile}={}) { | |
| const {name, id, profile} = this; | |
| return { | |
| name, | |
| id, | |
| ...(showProfile && {profile}) | |
| }; | |
| } |
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 function createAsyncCache(fn) { | |
| const cache = new WeakMap(); | |
| return { | |
| get(key) { | |
| if (cache.has(key)) { | |
| return cache.get(key); | |
| } | |
| const promise = Promise.resolve(fn(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
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| func main() { | |
| c := make(chan string) | |
| t := time.NewTicker(200 * time.Millisecond) |
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 ( | |
| "crypto/rand" | |
| "encoding/hex" | |
| "fmt" | |
| "io" | |
| ) | |
| func randomString(n int) (str string, err error) { |