Skip to content

Instantly share code, notes, and snippets.

@dre1080
dre1080 / docker.cadvisor.service
Last active June 6, 2018 23:14 — forked from pa-re/docker.cadvisor.service
/etc/systemd/system/docker.cadvisor.service
sudo docker create \
-v /:/rootfs:ro \
-v /var/run:/var/run:rw \
-v /sys:/sys:ro \
-v /var/lib/docker/:/var/lib/docker:ro \
-p 49876:8080 \
-m 50M \
--cpus 0.25 \
--cpuset-cpus 1 \
--name=cadvisor \
@dre1080
dre1080 / docker netdata
Last active June 13, 2018 19:20
docker netdata
sudo docker run -d \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /opt/netdata/overrides:/etc/netdata/override \
-p 19999:19999 \
-m 50M \
-e SMTP_SERVER=server \
-e SMTP_TO=email \
-e SMTP_USER=user \
@dre1080
dre1080 / _mixins.scss
Last active October 10, 2018 12:25
Element UI Spacing Utilities
@mixin res($key, $map: $--breakpoints) {
// 循环断点Map,如果存在则返回
@if map-has-key($map, $key) {
@media only screen and #{inspect(map-get($map, $key))} {
@content;
}
} @else {
@warn "Undefeined points: `#{$map}`";
}
}
@dre1080
dre1080 / Contract Killer 3.md
Last active October 22, 2018 11:47 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

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

Series:
{n.space('.').colon('-').replaceAll(/[!?.]+$/).replaceAll(/&/, 'and').replaceAll(/[`´‘’ʻ']/).replaceAll(/\*/, '-').replaceTrailingBrackets('$1')}.{s00e00}.{t.space('.').colon('-').replaceAll(/[!?.]+$/).replaceAll(/&/, 'and').replaceAll(/[`´‘’ʻ']/).replaceAll(/\*/, '-').replaceTrailingBrackets('$1')}
Movies:
{n.colon(' - ')} ({y})
@dre1080
dre1080 / deploy.sh
Created October 29, 2018 14:09
Zero Downtime Docker Compose Deploys
#!/usr/bin/env bash
CONTAINER_NAME="$1"
PROJECT_NAME="app"
# lets find the first container
FIRST_NUM=`docker ps | awk '{print $NF}' | grep app_$CONTAINER_NAME | awk -F "_" '{print $NF}' | sort | head -1`
NUM_OF_CONTAINERS=1
MAX_NUM_OF_CONTAINERS=2

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

Example

@dre1080
dre1080 / Dockerfile
Created October 23, 2019 21:26
Nuxt.js Multi-Stage Dockerfile
# Build
FROM node:latest as build-env
ENV NODE_ENV production
WORKDIR /src
COPY . .
RUN yarn install \
@dre1080
dre1080 / .dotfiles
Last active January 12, 2023 05:12
my dotfiles
my dotfiles