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
| #include <stdio.h> | |
| #include <openssl/pem.h> | |
| #include <openssl/rsa.h> | |
| int main(int argc, char *argv[]) { | |
| FILE *f = fopen(argv[1], "r"); | |
| RSA *key = PEM_read_RSAPrivateKey(f, NULL, NULL, NULL); | |
| RSA_print_fp(stdout, key, 0); | |
| fclose(f); |
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 golang:1.13 AS build | |
| ENV GO111MODULE on | |
| RUN go get github.com/caddyserver/caddy/caddy | |
| FROM busybox:1-glibc | |
| COPY --from=build /go/bin/caddy /usr/local/bin/caddy |
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 "/" do |env| | |
| count = env.session.int?("count") | |
| count = 0 unless count | |
| env.session.int("count", count+1) | |
| "Count = #{count}" | |
| end |
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) { |
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
| 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
| 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
| 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
| { | |
| "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
| http { | |
| server { | |
| listen 80; | |
| root /usr/share/nginx/html; | |
| location / { | |
| internal; | |
| } | |
| location ~ ^/(js/|img/|css/|favicon\.ico$) { |