Skip to content

Instantly share code, notes, and snippets.

View .zshrc
export GOPATH=$HOME/go
export GO111MODULE=on
export GOPROXY=""
if [ -d "$HOME/.composer/vendor/bin" ] ; then
if [ -d "$GOPATH" ] ; then
dre1080 /
Last active Apr 18, 2020 — forked from marek-saji/
Configure local DNS server to serve *.localhost domains

Configure local wildcard DNS server

  1. Install Dnsmasq: sudo apt-get install dnsmasq

  2. Since Ubuntu's NetworkManager uses dnsmasq, and since that messes things up a little for us, open up /etc/NetworkManager/NetworkManager.conf and comment out (#) the line that reads dns=dnsmasq. Restart NetworkManager afterwards: sudo systemctl restart NetworkManager.

  3. Make sure Dnsmasq listens to local DNS queries by editing /etc/dnsmasq.conf, and adding the line listen-address=

dre1080 / Dockerfile
Created Oct 23, 2019
Nuxt.js Multi-Stage Dockerfile
View Dockerfile
# Build
FROM node:latest as build-env
ENV NODE_ENV production
COPY . .
RUN yarn install \

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional


View gist:a3699bcb433f4d04d155955206a363e3
{'.').colon('-').replaceAll(/[!?.]+$/).replaceAll(/&/, 'and').replaceAll(/[`´‘’ʻ']/).replaceAll(/\*/, '-').replaceTrailingBrackets('$1')}.{s00e00}.{'.').colon('-').replaceAll(/[!?.]+$/).replaceAll(/&/, 'and').replaceAll(/[`´‘’ʻ']/).replaceAll(/\*/, '-').replaceTrailingBrackets('$1')}
{n.colon(' - ')} ({y})
dre1080 /
Created Oct 29, 2018
Zero Downtime Docker Compose Deploys
#!/usr/bin/env bash
# lets find the first container
FIRST_NUM=`docker ps | awk '{print $NF}' | grep app_$CONTAINER_NAME | awk -F "_" '{print $NF}' | sort | head -1`
dre1080 / Contract Killer
Last active Oct 22, 2018 — forked from malarkey/Contract Killer
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

dre1080 / parse_dotenv.bash
Created Oct 15, 2018 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
View parse_dotenv.bash
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
dre1080 / _mixins.scss
Last active Oct 10, 2018
Element UI Spacing Utilities
View _mixins.scss
@mixin res($key, $map: $--breakpoints) {
// 循环断点Map,如果存在则返回
@if map-has-key($map, $key) {
@media only screen and #{inspect(map-get($map, $key))} {
} @else {
@warn "Undefeined points: `#{$map}`";
You can’t perform that action at this time.