Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
// TODO: be life good

William Correa wilcorrea

🚀
// TODO: be life good
View GitHub Profile
@wilcorrea
wilcorrea / post-receive.sh
Created Feb 4, 2021 — forked from lfalmeida/post-receive.sh
Hook post receive com push options
View post-receive.sh
#!/bin/sh
# ---- Config
ENV_NAME="Homologação"
TAG_SUFFIX="homolog"
PROJECT_NAME="Scania Journey Event"
PROJECT_PATH_HOST="/home/lfalmeida/Projects/GitHooks/prod/"
PROJECT_PATH_DOCKER="/src/projeto"
SLACK_WEBHOOK=""
ENABLE_SLACK_POST=0
View campaign.html
<!-- Magna Analytics -->
<script>
(function (w, d, o = {}, a = '$a', u = '/analytics.js') {
t = 'script';r = 'Y31-fNd-LXB-jjn-I8U3';
w[r] = w[r] || {};w[r].o = o;
w[a] = w[a] || function () {(w[a].q = w[a].q || []).push(arguments)};
e = d.createElement(t);m = d.getElementsByTagName(t)[0];
e.async = 1;e.src = u + location.search;m.parentNode.insertBefore(e, m);
})(window, document)
$a('hit');
View full.html
<!-- Magna Analytics -->
<script>
(function (w, d, o = {}, a = '$a', u = '/analytics.js?key=164ff908-446c-41d5-a599-81e37b721be5') {
t = 'script';r = 'Y31-fNd-LXB-jjn-I8U3';
w[r] = w[r] || {};w[r].o = o;
w[a] = w[a] || function () {(w[a].q = w[a].q || []).push(arguments)};
e = d.createElement(t);m = d.getElementsByTagName(t)[0];
e.async = 1;e.src = u;m.parentNode.insertBefore(e, m);
})(window, document, { campaignId: 2 })
$a('hit', { shopId: 2 });
View with-payload.html
<!-- Magna Analytics -->
<script>
(function (w, d, o = {}, a = '$a', u = '/analytics.js?key=164ff908-446c-41d5-a599-81e37b721be5') {
t = 'script';r = 'Y31-fNd-LXB-jjn-I8U3';
w[r] = w[r] || {};w[r].o = o;
w[a] = w[a] || function () {(w[a].q = w[a].q || []).push(arguments)};
e = d.createElement(t);m = d.getElementsByTagName(t)[0];
e.async = 1;e.src = u;m.parentNode.insertBefore(e, m);
})(window, document)
$a('hit', { shopId: 1 });
View simple.html
<!-- Magna Analytics -->
<script>
(function (w, d, o = {}, a = '$a', u = '/analytics.js?key=164ff908-446c-41d5-a599-81e37b721be5') {
t = 'script';r = 'Y31-fNd-LXB-jjn-I8U3';
w[r] = w[r] || {};w[r].o = o;
w[a] = w[a] || function () {(w[a].q = w[a].q || []).push(arguments)};
e = d.createElement(t);m = d.getElementsByTagName(t)[0];
e.async = 1;e.src = u;m.parentNode.insertBefore(e, m);
})(window, document)
$a('hit');
View with-options.html
<!-- Magna Analytics -->
<script>
(function (w, d, o = {}, a = '$a', u = '/analytics.js?key=164ff908-446c-41d5-a599-81e37b721be5') {
t = 'script';r = 'Y31-fNd-LXB-jjn-I8U3';
w[r] = w[r] || {};w[r].o = o;
w[a] = w[a] || function () {(w[a].q = w[a].q || []).push(arguments)};
e = d.createElement(t);m = d.getElementsByTagName(t)[0];
e.async = 1;e.src = u;m.parentNode.insertBefore(e, m);
})(window, document, { campaignId: 1 })
$a('hit');
View my.docker-compose.yml
version: '3'
networks:
reverse-proxy:
external:
name: reverse-proxy
services:
test-app:
image: webdevops/php-nginx:7.4
View post-receive
#!/usr/bin/env bash
DIR_NAME=$(dirname $(readlink -f ${0}))
APP="$(dirname $(readlink -f "${DIR_NAME}/.."))/app"
REPO="$(dirname ${DIR_NAME})"
BRANCH="main"
while read oldrev newrev ref
do
BRANCH=`echo $ref | cut -d/ -f3`
@wilcorrea
wilcorrea / docker-compose.yml
Last active Nov 24, 2020
Docker Compose para manter
View docker-compose.yml
version: '3.7'
# make sure everything is running with:
# docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}" | grep "nginx-"
#networks
networks:
#network reverse-proxy
reverse-proxy:
external: true
View checker.sh
#!/bin/bash
# usage:
# checker "https://myapp.com"
counter=0
while true
do
counter=$((counter + 1))
status=$(curl -o /dev/null -s -w "%{http_code}\n" ${1})