Skip to content

Instantly share code, notes, and snippets.

View luizeof's full-sized avatar
🎯
Focusing

Luiz Eduardo de Oliveira Fonseca luizeof

🎯
Focusing
View GitHub Profile
@luizeof
luizeof / senderscore.sh
Created September 6, 2018 12:02 — forked from agarzon/senderscore.sh
Check Sender Score from IP using command line. bash script
#!/usr/bin/env bash │ject-with tcp-reset
# usage: ./senderscore.sh 74.91.28.11
if [ -z "$1" ]
then
echo "IP is missing as arguemnt."
exit
fi
IP=$1
#!/bash/bin
# Instala o Proxy Reverso com o Nginx e o SSL
docker run -d --restart always -p 80:80 -p 443:443 \
--name nginx-proxy \
-v /path/to/certs:/etc/nginx/certs:ro \
-v /etc/nginx/vhost.d \
-v /usr/share/nginx/html \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
@luizeof
luizeof / update.sh
Last active July 24, 2018 18:35
transifex-mautic-command
php app/console mautic:transifex:pull --language=pt_BR # para o nosso idioma
php app/console mautic:transifex:pull # para todos os idiomas
php app/console cache:clear
@luizeof
luizeof / local.php
Last active July 24, 2018 18:29
transifex-mautic.php
<?php
$parameters = array(
'site_url' => 'https://mautic.example.com',
'install_source' => 'Mautic',
'db_driver' => 'pdo_mysql',
...
...
// em algum lugar do arquivo local.php você pode colocar as credenciais do Transifex
'transifex_username' => 'usuario',
'transifex_password' => 'senha'
@luizeof
luizeof / mautic-form.js
Last active October 6, 2021 20:53
Manipulando Eventos de um formulário e enviando para o Mautic
<script>
// Coloque em qualquer parte do código
document.addEventListener('DOMContentLoaded', function () {
// Aqui você coloca o ID do seu formulário que será manipulado
document.getElementById("myForm").onsubmit = function(e) {myFunction(e)};
function myFunction(e) {
// altere aqui a url do seu mautic
#==========================================
# Exemplo de crontab para listas grandes com mais de 5 mil leads
#
# Neste exemplo damos um tempo para que
# cada tarefa tenha tempo de ser executada
# antes da próxima tarefa entrar em execução
#===========================================
# atualiza as listas nos minutos 1 e 30
#==========================================
# Exemplo de crontab para listas grandes
# com mais de 5 mil leads
#
# Neste exemplo damos um tempo para que
# cada tarefa tenha tempo de ser executada
# antes da próxima tarefa entrar em execução
#===========================================
# atualiza as listas nos minutos 1 e 30
@luizeof
luizeof / compression.rb
Created May 3, 2018 19:02 — forked from paulomcnally/compression.rb
Ruby on Rails: Minify HTML, CSS, & JS, and compress with gzip https://remino.net/rails-html-css-js-gzip-compression/
# config/initializers/compression.rb
Rails.application.configure do
# Use environment names or environment variables:
# break unless Rails.env.production?
break unless ENV['ENABLE_COMPRESSION'] == '1'
# Strip all comments from JavaScript files, even copyright notices.
# By doing so, you are legally required to acknowledge
# the use of the software somewhere in your Web site or app:
@luizeof
luizeof / application.html.erb
Created April 2, 2018 20:30 — forked from the-bass/application.html.erb
Using Google Analytics with Rails 5 and Turbolinks 5. This code is taken from the conversation between @preetpalS and @packagethief on https://github.com/turbolinks/turbolinks/issues/73.
<%# Put this code snippet between the <head></head>-tags in your application layout and %>
<%# replace 'UA-XXXXXXXX-X' with your own unique Google Analytics Tracking ID %>
<%# ... %>
<head>
<%# ... %>
<% if Rails.env.production? %>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@luizeof
luizeof / email.html
Created January 5, 2018 21:15 — forked from aziraphale/email.html
magic "Confirm Subscription" link in Google Inbox for Mailchimp subscription confirmation email
<!-- Google Inbox displayed a "Confirm Subscription" link button immediately below the subject line, both when the
email was opened and when it was closed. Clicking the button would confirm the subscription without the browser
visibly opening the confirmation link. -->
<span itemscope itemtype="http://schema.org/EmailMessage">
<span itemprop="description" content="We need to confirm your email address."></span>
<span itemprop="action" itemscope itemtype="http://schema.org/ConfirmAction">
<meta itemprop="name" content="Confirm Subscription">
<span itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler">
<meta itemprop="url" content="https://carloop.us6.list-manage.com/subscribe/smartmail-confirm?u=...&id=...&e=...&inline=true">