Skip to content

Instantly share code, notes, and snippets.

Avatar
🏐
Focusing

ORES ORESoftware

🏐
Focusing
View GitHub Profile
@ORESoftware
ORESoftware / ubuntu.md
Last active Jul 22, 2020
how to tell yourself when you need to merge with master / integration when you are working on a feature branch
View ubuntu.md

this will work on linux where notify-send is installed

throw this snippet into ~/.bashrc

((

    branch_name=dev
@ORESoftware
ORESoftware / query.json
Created Jul 6, 2020
es query for version 7
View query.json
{
"from": 0,
"query": {
"bool": {
"must": [
{
"simple_query_string": {
"query": "*"
}
},
@ORESoftware
ORESoftware / rjh.md
Last active May 27, 2020
rosanna joy hetrick
View rjh.md

love stanza 1

i express my love differently than some people i think pictures are nice but black and white text is cool too i think you make tasty snax you are a kickass persona

zan fux

@ORESoftware
ORESoftware / build-and-run.sh
Last active Apr 30, 2020
Build and run docker image/container
View build-and-run.sh
#!/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")"
(
@ORESoftware
ORESoftware / golang.Dockerfile
Last active May 11, 2020
How to create an optimized dockerfile for go services
View golang.Dockerfile
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
View get-token-for-cloud-run.go
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"
@ORESoftware
ORESoftware / async.md
Created Apr 13, 2020
async-await and outer scope changes
View async.md

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)
@ORESoftware
ORESoftware / os-release.md
Created Mar 31, 2020
alex ubuntu /etc/os-release info
View os-release.md

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
@ORESoftware
ORESoftware / chucked-response.md
Last active Mar 2, 2020
streaming an http response
View chucked-response.md

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) => {
@ORESoftware
ORESoftware / root.jsx
Last active Feb 24, 2020
Our root.jsx file, which is not the entry point, the entry point is the parent of this file
View root.jsx
import {Provider} from "react-redux";
import {
Router,
Route,
browserHistory,
} from "react-router"
You can’t perform that action at this time.