These rules are adopted from the AngularJS commit conventions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |
The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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}`"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |
Configure local wildcard DNS server
-
Install Dnsmasq:
sudo apt-get install dnsmasq
-
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 readsdns=dnsmasq
. Restart NetworkManager afterwards:sudo systemctl restart NetworkManager
. -
Make sure Dnsmasq listens to local DNS queries by editing
/etc/dnsmasq.conf
, and adding the linelisten-address=127.0.0.1
.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package util | |
import ( | |
"log" | |
"strings" | |
"github.com/labstack/echo" | |
) | |
// DebugPrintRoutes prints all registered routes of e. |