- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
- When only changing documentation, include
[ci skip]
in the commit title - Consider starting the commit message with an applicable emoji
Discover gists
This file contains 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
//... | |
public function register() | |
{ | |
$this->app->singleton('command.migrate.fresh', function () { | |
return new FreshCommand(); | |
}); | |
} | |
//... |
This file contains 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 OR REPLACE FUNCTION generate_offline_uuid( | |
username_p VARCHAR(20) | |
) RETURNS VARCHAR(36) BEGIN | |
DECLARE uuid_bytes VARCHAR(36); | |
SELECT MD5(CONCAT('OfflinePlayer:', username_p)) INTO uuid_bytes; | |
SELECT INSERT(uuid_bytes, 13, 2, HEX(CONV(SUBSTR(uuid_bytes, 13, 2), 16, 10) & 0x0f | 0x30)) INTO uuid_bytes; | |
SELECT INSERT(uuid_bytes, 17, 2, HEX(CONV(SUBSTR(uuid_bytes, 17, 2), 16, 10) & 0x3f | 0x80)) INTO uuid_bytes; | |
RETURN (SELECT LCASE(CONCAT_WS('-', | |
SUBSTR(uuid_bytes, 1, 8), | |
SUBSTR(uuid_bytes, 9, 4), |
This file contains 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
curl -L -k -s https://www.example.com | tac | sed "s#\\\/#\/#g" | egrep -o "src['\"]?\s*[=:]\s*['\"]?[^'\"]+.js[^'\"> ]*" | awk -F '//' '{if(length($2))print "https://"$2}' | sort -fu | xargs -I '%' sh -c "curl -k -s \"%\" | sed \"s/[;}\)>]/\n/g\" | grep -Po \"(['\\\"](https?:)?[/]{1,2}[^'\\\"> ]{5,})|(\.(get|post|ajax|load)\s*\(\s*['\\\"](https?:)?[/]{1,2}[^'\\\"> ]{5,})\"" | awk -F "['\"]" '{print $2}' | sort -fu | |
# using linkfinder | |
function ejs() { | |
URL=$1; | |
curl -Lks $URL | tac | sed "s#\\\/#\/#g" | egrep -o "src['\"]?\s*[=:]\s*['\"]?[^'\"]+.js[^'\"> ]*" | sed -r "s/^src['\"]?[=:]['\"]//g" | awk -v url=$URL '{if(length($1)) if($1 ~/^http/) print $1; else if($1 ~/^\/\//) print "https:"$1; else print url"/"$1}' | sort -fu | xargs -I '%' sh -c "echo \"\n##### %\";wget --no-check-certificate --quiet \"%\"; basename \"%\" | xargs -I \"#\" sh -c 'linkfinder.py -o cli -i #'" | |
} | |
# with file download (the new best one): | |
# but there is a bug if you don't provide a root url |
This file contains 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
[Interface] | |
Address = <...> | |
MTU = 1412 | |
PrivateKey = <...> | |
DNS = <...> | |
PostUp = iptables -t nat -A POSTROUTING -o %i -j MASQUERADE; iptables -A FORWARD -i %i -m state --state RELATED,ESTABLISHED -j ACCEPT; iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu | |
PostDown = iptables -t nat -D POSTROUTING -o %i -j MASQUERADE; iptables -D FORWARD -i %i -m state --state RELATED,ESTABLISHED -j ACCEPT; iptables -D FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu | |
[Peer] |
This file contains 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
#!/bin/bash | |
if ! [ -x "$(command -v zip)" ]; then | |
echo 'Error: zip is not installed.' >&2 | |
exit 1 | |
fi | |
if ! [ -x "$(command -v unzip)" ]; then | |
echo 'Error: unzip is not installed.' >&2 | |
exit 1 | |
fi |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:ac="http://www.atlassian.com/schema/confluence/4/ac/" | |
xmlns:ri="http://www.atlassian.com/schema/confluence/4/ri/" | |
xmlns:acxhtml="http://www.atlassian.com/schema/confluence/4/" | |
xmlns="http://www.w3.org/1999/xhtml" | |
exclude-result-prefixes="xsl ac ri acxhtml"> | |
<!-- Transform Confluence storage format to XHTML --> |
This file contains 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
/* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. | |
**/ | |
header { | |
display: flex; | |
justify-content: center; |
This file contains 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
<template> | |
<v-list-group :prepend-icon="(subGroup) ? null : item.icon" :sub-group="subGroup"> | |
<template v-slot:activator> | |
<v-list-item-title>{{ item.text }} + {{subGroup}}</v-list-item-title> | |
</template> | |
<template v-for="(child, i) in item.children"> | |
<list-group v-if="isGroupItem(child)" :key="i" :item="child" subGroup></list-group> | |
<list-item v-else :key="i" :text="child.text" :icon="child.icon"></list-item> | |
</template> |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
NewerOlder