Skip to content

Instantly share code, notes, and snippets.

@2dev2
2dev2 / envoy-config.yaml
Created August 12, 2024 19:36 — forked from poolski/envoy-config.yaml
Sample Envoy Config
---
# Envoy requires this to be configured, even if you don't intend to use the admin interface.
admin:
access_log_path: "/var/log/envoy/envoy-admin.log"
address:
socket_address:
address: 127.0.0.1
port_value: 8001
# Identify your node/pod/instance/whatever.
node:
@2dev2
2dev2 / install-docker.md
Created March 25, 2023 12:11 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@2dev2
2dev2 / sync-using-gitignore.sh
Created February 19, 2023 13:10 — forked from theothermattm/sync-using-gitignore.sh
Rsync files using .gitignore
# sync everything excluding things in .gitignore
# delete anything on target not in source
# include dotfiles and symlinks, also use compression
rsync -azP --delete --filter=":- .gitignore" . my-target-host:/my/target/directory
@2dev2
2dev2 / previous-git-tag.sh
Created October 4, 2022 02:47 — forked from kjantzer/previous-git-tag.sh
Get Previous Git Tag (the one before the latest tag)
# http://stackoverflow.com/a/28818420/484780
git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`
@2dev2
2dev2 / gist:201985a7a9634c183a5aa2c437e9a3e5
Created March 29, 2020 05:35 — forked from aodin/gist:9493190
Parsing JSON in a request body with Go
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
)
type Message struct {
@2dev2
2dev2 / cmd.sh
Created January 8, 2020 19:27 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@2dev2
2dev2 / react.md
Created July 26, 2019 01:17 — forked from vasanthk/react.md
React and Reconcilers in Reason

React

This is the base of all projects and it will include the foundation for all potential react-based projects in Reason.

This base package should include a ReasonReact api to promote collaboration and familiarity with people using a ReasonReact, and for the modern world of React this should also include a Hooks api that currently revery uses.

React module

All blocks in Jsx are of type React.reactElement. This reactElement should represent:

@2dev2
2dev2 / _1_"script async defer" blocks "load" event.md
Created July 26, 2019 01:16
Beware of "script async defer" blocking HTML "load" event

Beware of <script async defer> blocking HTML "load" event

2015.10.07 t

On the importance of simulated latency testing, and bulletproofing your page from the third-party JS load failures

TL;DR

@2dev2
2dev2 / System Design.md
Created July 26, 2019 01:04 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@2dev2
2dev2 / README.md
Created December 1, 2015 06:32 — forked from brattonc/README.md
D3 Liquid Fill Gauge

Liquid Fill Gauge v1.1 - 7/14/2015

Changes:

  • Added support for updating the gauge value after loading is complete. The loadLiquidFillGauge method now returns an object with an update method which allows the gauge value to be changed. Click any of the gauges above to randomly update their value.

Configurable features include:

  • Changeable min/max values.
  • All colors.