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 nonblocking | |
| import ( | |
| "io" | |
| "time" | |
| ) | |
| type NonBlockingReader struct { | |
| ch chan []byte | |
| rd io.Reader |
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
| @discardableResult | |
| public func then<U>(_ onFulfilled: @escaping (T) throws -> U) -> Promise<U> { | |
| return self.thenImpl(onFulfilled, { throw $0 }) | |
| } | |
| @discardableResult | |
| public func then<U>(_ onFulfilled: @escaping (T) throws -> U, _ onRejected: @escaping (Error) throws -> U) -> Promise<U> { | |
| return self.thenImpl(onFulfilled, onRejected) | |
| } | |
| @discardableResult |
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" | |
| "io" | |
| "log" | |
| "net/http" | |
| "os" | |
| "time" | |
| ) |
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 --git a/yarn.lock b/yarn.lock | |
| index 4ad8aa0..86e8f3a 100644 | |
| --- a/yarn.lock | |
| +++ b/yarn.lock | |
| @@ -39,42 +39,18 @@ asn1@0.1.11: | |
| version "0.1.11" | |
| resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.1.11.tgz#559be18376d08a4ec4dbe80877d27818639b2df7" | |
| -asn1@~0.2.3: | |
| - version "0.2.3" |
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 --git a/yarn.lock b/yarn.lock | |
| index 2e5918c..b54dd76 100644 | |
| --- a/yarn.lock | |
| +++ b/yarn.lock | |
| @@ -39,42 +39,18 @@ asn1@0.1.11: | |
| version "0.1.11" | |
| resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.1.11.tgz#559be18376d08a4ec4dbe80877d27818639b2df7" | |
| -asn1@~0.2.3: | |
| - version "0.2.3" |
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
| // A couple of middleware http.Handler functions (scroll down). | |
| // EXAMPLE USAGE: | |
| http.HandleFunc("/", RequestHome) | |
| http.Handle("/s/", Cacher(168*time.Hour, http.StripPrefix("/s/", http.FileServer(http.Dir("static"))))) | |
| http.Handle("/favicon.ico", FileWithCache("static/favicon.ico", 168*time.Hour)) | |
| if err := http.ListenAndServe(":8080", Logger(http.DefaultServeMux)); err != nil { | |
| log.Fatalf("http.ListenAndServe: %v", err) |
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
| Verifying that "blixt.id" is my Blockstack ID. https://onename.com/blixt |
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 ( | |
| "context" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| "time" |
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
| Verifying my Blockstack ID is secured with the address 1B9f1ZMCJzGfG4yzy3gyshA87whqkQTRj https://explorer.blockstack.org/address/1B9f1ZMCJzGfG4yzy3gyshA87whqkQTRj |
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
| # First, outside the Dockerfile: | |
| tar --exclude ./static-large --exclude-from=.dockerignore -czf non-large.tar.gz ./* | |
| # Then, in the Dockerfile: | |
| COPY static-large $WORKDIR_PATH/static-large/ | |
| ADD non-large.tar.gz $WORKDIR_PATH/ |