Skip to content

Instantly share code, notes, and snippets.

@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})

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 / localhost-tld.md
Last active April 18, 2020 10:52 — forked from marek-saji/dev-tld.md
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=127.0.0.1.

@dre1080
dre1080 / fix.md
Created October 19, 2020 18:57
megasync fix for deepin OS v20

you can fix this by adding the env variable in the launch file:

nano /usr/share/applications/megasync.desktop

and then replace Exec=megasync with Exec=env QT_SCALE_FACTOR=1 megasync

remove the TryExec line and save. you can then copy the megasync.desktop launch file to your autostart folder, e.g.:

@dre1080
dre1080 / config.yml
Last active October 20, 2020 00:36 — forked from Surendrajat/config.yml
fusuma multitouch gesture config for elementary OS
swipe:
3:
left:
command: 'xdotool key ctrl+super+Left'
right:
command: 'xdotool key ctrl+super+Right'
up:
command: 'xdotool key ctrl+t'
threshold: 1.5
down: