git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9
mv 6fb35afd237e42ef25f9 ConvertTo-Markdown
cd ConvertTo-Markdown
| defmodule Expng do | |
| defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks] | |
| def png_parse(<< | |
| 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, | |
| _length :: size(32), | |
| "IHDR", | |
| width :: size(32), | |
| height :: size(32), |
| <html> | |
| <head> | |
| <title>DevTools Test</title> | |
| </head> | |
| <body> | |
| <script> | |
| if ('serviceWorker' in navigator) { | |
| navigator.serviceWorker.register('sw.js'); | |
| // Wait until the SW has taken control of the page before inserting the <script> elements. | |
| // That way we can be sure the SW's fetch handler will intercept them. |
| # Make sure you grab the latest version | |
| curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip | |
| # Unzip | |
| unzip protoc-3.2.0-linux-x86_64.zip -d protoc3 | |
| # Move protoc to /usr/local/bin/ | |
| sudo mv protoc3/bin/* /usr/local/bin/ | |
| # Move protoc3/include to /usr/local/include/ |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
| { | |
| "services": [ | |
| { "id": "webservice-backup", | |
| "name": "webservice", | |
| "tags": ["backup"], | |
| "port": 80, | |
| "checks": [{ | |
| "name": "DNS check ", | |
| "script": "/usr/lib64/nagios/plugins/negate -s /usr/lib64/nagios/plugins/check_dns -H cdnhealth.service.cdn.example.com.", | |
| "interval": "5s", |
| #!/bin/bash | |
| consul event -name 'Name of your event' -token=$CONSUL_TOKEN 'Some payload, you should probably use JSON here' | |
| rm -rf /tmp/install | |
| mkdir -p /tmp/install | |
| cd /tmp/install | |
| apt-get update | |
| apt-get install -y wget unzip dnsutils | |
| wget https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_linux_amd64.zip | |
| unzip consul_0.6.4_linux_amd64.zip | |
| install consul /usr/local/bin/consul | |
| mkdir -p /etc/consul | |
| mkdir -p /var/lib/consul |
| rm -rf /tmp/install | |
| mkdir -p /tmp/install | |
| cd /tmp/install | |
| apt-get update | |
| apt-get install -y wget unzip dnsutils | |
| wget https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_linux_amd64.zip | |
| unzip consul_0.6.4_linux_amd64.zip | |
| install consul /usr/local/bin/consul | |
| mkdir -p /etc/consul | |
| mkdir -p /var/lib/consul |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.