Skip to content

Instantly share code, notes, and snippets.

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 / 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

@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 / 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 / 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 / .powenv
Last active March 21, 2018 14:06
Using Pow!! with Foreman (Configuration)
# In your app's root.
# Make Pow!! export all the env variables contained in the .env file used by Foreman.
export $(cat .env)
@dre1080
dre1080 / watch.sh
Created April 27, 2012 04:57
Compile and watch Sass (using Compass) and CoffeeScript files with one command
#!/bin/bash
type -P compass &>/dev/null || { echo "Compass command not found."; exit 1; }
type -P coffee &>/dev/null || { echo "Coffee command not found."; exit 1; }
# Get current directory (project path)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SASS_DIR="$DIR/public/stylesheets/sass/"
CSS_DIR="$DIR/public/stylesheets/"
@dre1080
dre1080 / soft-delete.sql
Last active February 10, 2016 10:08
Soft-deletable records in Postgres
CREATE FUNCTION soft_delete()
RETURNS trigger AS $$
BEGIN
EXECUTE 'UPDATE '
|| TG_TABLE_NAME
|| ' SET deleted_at = current_timestamp WHERE id = $1'
USING OLD.id;
RETURN OLD;
END;
$$ LANGUAGE plpgsql
@dre1080
dre1080 / all2coffee.sh
Created November 9, 2013 01:25
Js2Coffee a directory recursively. Excludes node_modules, app/assets and public directories.
for FILE in `find . -name "*.js" -type f -o -path './node_modules' -prune -o -path './app/assets' -prune -o -path './public' -prune`
do
if [ -e $FILE ] ; then
COFFEE=${FILE//.js/.coffee}
echo "converting ${FILE} to ${COFFEE}"
js2coffee "$FILE" > "$COFFEE"
else
echo "File: {$1} does not exist!"
fi