Skip to content

Instantly share code, notes, and snippets.

brew install dnsmasq
sudo echo 'address=/.test/127.0.0.1' >> /usr/local/etc/dnsmasq.conf
sudo mkdir -p /etc/resolver
echo 'nameserver 127.0.0.1' | sudo tee /etc/resolver/test
sudo brew services restart dnsmasq
function Employee() {
this.name = '';
this.dept = 'general';
}
function Manager() {
Employee.call(this);
this.reports = [];
}
{
"extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
"linterOptions": {
"exclude": ["config/**/*.js", "node_modules/**/*.ts"]
},
"rules": {
"arrow-parens": false,
"eofline": false,
"interface-name": false,
"jsx-boolean-value": false,
@weivall
weivall / .gitlab-ci.yml
Created July 11, 2018 12:18 — forked from foklepoint/.gitlab-ci.yml
Build and Push images to GCP Container Registry with Gitlab CI
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
lifecycle:
preStop:
exec:
# A hack to try to get 0% downtime during deploys. This should
# help ensure k8s eventually stops giving this node traffic.
command: ["sh", "-c", "sleep 5"]
@weivall
weivall / groupcache.go
Created December 12, 2017 15:01 — forked from fiorix/groupcache.go
Simple groupcache example
// Simple groupcache example: https://github.com/golang/groupcache
// Running 3 instances:
// go run groupcache.go -addr=:8080 -pool=http://127.0.0.1:8080,http://127.0.0.1:8081,http://127.0.0.1:8082
// go run groupcache.go -addr=:8081 -pool=http://127.0.0.1:8081,http://127.0.0.1:8080,http://127.0.0.1:8082
// go run groupcache.go -addr=:8082 -pool=http://127.0.0.1:8082,http://127.0.0.1:8080,http://127.0.0.1:8081
// Testing:
// curl localhost:8080/color?name=red
package main
import (
@weivall
weivall / Vagrantless
Created October 15, 2017 09:37 — forked from mikhailov/Vagrantless
Vagrantless (draft), tested on OS X only.
# This the bash script to handle up-and-runnig VM created through Vagrant
#!/usr/bin/env bash
# PRIVATE: error level message
error_message () {
echo "$(tput setaf 1)ERROR: $1$(tput sgr0)"
}
@weivall
weivall / fission-minikube-helm.sh
Created May 29, 2017 12:19 — forked from sanketsudake/fission-minikube-helm.sh
Fission with Minikube and Helm
# Install virtualbox
sudo apt install virtualbox
# Install Kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin
# Install Minikube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.14.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
# Launch Minikube
minikube start
@weivall
weivall / .block
Created May 18, 2017 09:54 — forked from mbostock/.block
SVG foreignObject Example
license: gpl-3.0
@weivall
weivall / Link.jsx
Created May 17, 2017 15:40 — forked from tayiorbeii/Link.jsx
Link.jsx is a wrapper for react-router's Link that adds some helper functionality for things like relative links.