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
<link rel="stylesheet" href="/assets/js/gitalk/v1.6.8/gitalk.css"> | |
<script src="/assets/js/gitalk/v1.6.8/gitalk.min.js"></script> | |
<div id="js-gitalk-container"></div><script> | |
var locationArr = window.location.pathname.split('/') | |
var gitalk = new Gitalk({ | |
clientID: '', | |
clientSecret: '', | |
repo: 'gitalk_comments', |
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
//example values | |
module.exports = { | |
appId: '3b576084h403303u32', //https://github.com/settings/developers - CliendID | |
appSecret: '403303u3294746895468957942rfasdfhdasfads21032131', //https://github.com/settings/developers - ClientSecret | |
origin: 'https://e44ff76c.myblog-bkz.pages.dev', //your domain or * for any domains origin | |
accessToken: 'jdsaofdhsfhsdaifbsdjafb38482914312nd', //https://github.com/settings/tokens | |
state: 'random string', | |
redirectURI: 'https://gitalk-anonmously-comment-kappa.vercel.app/api/access_token' //vercel domain | |
} |
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
name: Ranking featured posts | |
on: | |
push: | |
branches: [ master ] | |
schedule: | |
# At 07:00 (every day) | |
- cron: '0 7 * * *' |
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 | |
#marllus.com | |
cat export.txt | cut -d',' -f1 | sort | uniq -c | sort -r | egrep '\ \/(tecnologia|poesia|sociedade|arte)' | head -4 | sed 's/^\ *//g' | cut -d' ' -f2 | sed 's/^\/.*\///g ; s/\.html//g' > ranking_posts | |
cat export.txt | cut -d',' -f1,2 | sort | uniq -c | sort -r | egrep '\ \/(tecnologia|poesia|sociedade|arte)' | head -4 | sed 's/^\ .//g' | cut -d',' -f1,2 | sed 's/^\ *\([0-9]\+\)\ *.*html,\(.*$\)/- \2 (\1 views)/g' > ranking_posts_name | |
sed -i '1 i\Há uma mudança nos artigos em destaque. Segue a lista dos mais vistos:' ranking_posts_name | |
#remove previous featured in posts | |
find _posts/ -name "*.md" | xargs -n 1 sed -i '/^featured:\ true/d ; /^hidden:\ true/d ; /^rating:\ [1-5]\{1\}/d' |
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 | |
# https://www.goatcounter.com/code/api#export-64 | |
token=$1 | |
api=$2 | |
curl() { | |
\command curl \ | |
-H 'Content-Type: application/json' \ | |
-H "Authorization: Bearer $token" \ | |
"$@" |
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
docker run -d \ | |
--name watchtower \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-e WATCHTOWER_NOTIFICATIONS=email \ | |
-e WATCHTOWER_NOTIFICATION_EMAIL_FROM=fromaddresssengrid@example.com \ | |
-e [email protected] \ | |
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.sendgrid.net \ | |
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \ | |
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=apikey \ | |
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=tokensendgrid \ |
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
name: Workflow - sendgrid pull push | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
# Variavel de ambiente vista para qualquer job |
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
name: Workflow - scan agendado | |
on: | |
schedule: | |
# toda segunda-feira às 5 horas da matina! | |
- cron: '0 5 * * 1' | |
env: | |
# Variavel de ambiente vista para qualquer job | |
# nome da imagem - altere para o nome correto |
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
name: Workflow - build/push | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
# Variavel de ambiente vista para qualquer job |
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
# ---------------------------------- | |
# Colors | |
# ---------------------------------- | |
NOCOLOR='\033[0m' | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
ORANGE='\033[0;33m' | |
BLUE='\033[0;34m' | |
PURPLE='\033[0;35m' | |
CYAN='\033[0;36m' |
NewerOlder