Skip to content

Instantly share code, notes, and snippets.

@derrickwilliams
derrickwilliams / adding-prettier-to-projects.md
Created February 3, 2019 04:16 — forked from whoisryosuke/adding-prettier-to-projects.md
Workflow - Adding ESLint (Airbnb) + Prettier to projects
# Install ESLint and Babel ESLint
# Make sure to install at least v5.1.0 of ESLint
npm install --save-dev eslint babel-eslint

# Install the Airbnb configs (3 of them, listed below)
npx install-peerdeps --dev eslint-config-airbnb

# Install Prettier + ESLint config
npm install --save-dev --save-exact prettier eslint-config-prettier
@derrickwilliams
derrickwilliams / proxy.go
Created January 18, 2018 14:51
golang proxy example
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"net/url"
"github.com/darkhelmet/env"
@derrickwilliams
derrickwilliams / index.html
Created January 18, 2018 14:17
Responsive iframe example
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1>Main Page</h1>
<iframe class="wide-iframe" src="index2.html"></iframe>
<iframe class="narrow-iframe" src="index2.html"></iframe>
var colorHelper = {
// only accepts hex values for now
transitionSteps: function(colors, numberOfSteps) {
var _this = this;
var fromColor = _this.hexToRGB(colors.from);
var toColor = _this.hexToRGB(colors.to);
var diff = rgbDiff(fromColor, toColor);
var steps = breakIntoSteps(diff, numberOfSteps);
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"net/url"
"github.com/darkhelmet/env"
{
"presets": ["env"],
"plugins": ["external-helpers"]
}
user www www; ## Default: nobody
worker_processes 5; ## Default: 1
error_log logs/error.log;
pid logs/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096; ## Default: 1024
}
@derrickwilliams
derrickwilliams / RDS-Aurora-CloudFormation-Example.yaml
Created March 14, 2017 04:16 — forked from sjparkinson/RDS-Aurora-CloudFormation-Example.yaml
A basic CloudFormation template for an RDS Aurora cluster.
---
AWSTemplateFormatVersion: 2010-09-09
Description: A basic CloudFormation template for an RDS Aurora cluster.
Parameters:
DatabaseInstanceType:
Default: db.r3.large
AllowedValues:
- db.r3.large
- db.r3.xlarge
- db.r3.2xlarge
@derrickwilliams
derrickwilliams / docker-swarm-ports.md
Created March 10, 2017 14:48 — forked from BretFisher/docker-swarm-ports.md
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management communications
  • TCP and UDP port 7946 for communication among nodes
  • TCP and UDP port 4789 for overlay network traffic

AWS Security Group Example

AWS Tip: You should use Security Groups in AWS's "source" field rather then subnets, so SG's will all dynamically update when new nodes are added.

@derrickwilliams
derrickwilliams / AWS Swarm cluster.md
Created March 7, 2017 16:07 — forked from ghoranyi/AWS Swarm cluster.md
Create a Docker 1.12 Swarm cluster on AWS

This gist will drive you through creating a Docker 1.12 Swarm cluster (with Swarm mode) on AWS infrastructure.

Prerequisites

You need a few things already prepared in order to get started. You need at least Docker 1.12 set up. I was using the stable version of Docker for mac for preparing this guide.

$ docker --version
Docker version 1.12.0, build 8eab29e

You also need Docker machine installed.