This problem:
let mightChange = {id:1}
const doWork = async v => {
const result1 = await doSomethingWith(mightChange);
const result2 = await doAnotherThingWith(mightChange); // mightChange.id might be mutated
return doSomething(result2)
#!/usr/bin/env bash | |
# the nice thing about this script is it will remove | |
# existing containers in the background | |
# while the new image is being built | |
set -eo pipefail | |
cd "$(dirname "$BASH_SOURCE")" | |
( |
FROM golang:1.13 as base_img | |
ADD ./netrc /root/.netrc | |
ENV GO111MODULE='on' | |
ENV GOPROXY='direct' | |
ENV GOSUMDB='off' | |
RUN mkdir -p /tmp/go-api |
package common | |
import ( | |
"cloud.google.com/go/compute/metadata" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"github.com/acme/go-api/config/proj" | |
jwtgo "github.com/acme/jwt-go" | |
"golang.org/x/oauth2" |
This problem:
let mightChange = {id:1}
const doWork = async v => {
const result1 = await doSomethingWith(mightChange);
const result2 = await doAnotherThingWith(mightChange); // mightChange.id might be mutated
return doSomething(result2)
well here is the output of cat /etc/os-release
:
oleg@xps:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
If you copy this file and transpile with tsc, you will see that the headers get buffered, but the body is streamed line-by-line, where a new line of JSON arrives to the client every second. But is there a way to stream headers too, not just the body?
import * as http from 'http';
const server = http.createServer((req,res) => {
import {Provider} from "react-redux"; | |
import { | |
Router, | |
Route, | |
browserHistory, | |
} from "react-router" |
import Root from './root.jsx' | |
ReactDOM.render( | |
<Root/>, | |
document.getElementById('app') | |
); | |
if (module.hot) { | |
// this is necessary for HMR, the only thing we need for the whole app which is nice | |
module.hot.accept('./root.jsx', () => { |
if (!ignoreWebpack && !inProduction) | |
const webpack = require('webpack'); | |
const webpackMiddleware = require('webpack-dev-middleware'); | |
const WebpackDashboardPlugin = require('webpack-dashboard/plugin'); | |
const config = require('./webpack.config.dev'); | |
const compiler = webpack(config); | |
app.use(require("webpack-hot-middleware")(compiler)); |
cm_env_exp() { | |
rm -rf /tmp/srv-input | |
mkfifo /tmp/srv-input | |
rm -rf /tmp/srv-output | |
mkfifo /tmp/srv-output | |
( |