Skip to content

Instantly share code, notes, and snippets.

View thelinuxlich's full-sized avatar
🐉
Here be dragons

Alisson Cavalcante Agiani thelinuxlich

🐉
Here be dragons
View GitHub Profile
@thelinuxlich
thelinuxlich / form_submit.js
Created July 19, 2016 18:05
Form Submit with delay for Analytics
$('#form_id').submit(function(e) {
var form = this;
e.preventDefault(); // disable the default submit action
ax.identify(email);
$(':input', this).attr('disabled', true); // OPTIONAL: disable all elements in the form, to avoid multiple clicks
setTimeout(function() { // after 1 second, submit the form
form.submit();
module.exports = {
"rules": {
"no-console": false,
"indent": [
2,
4
],
"quotes": [
2,
"double"
@thelinuxlich
thelinuxlich / get_href.js
Created February 16, 2016 20:22
getHref
var urlencode = function(str) {
return encodeURIComponent(str)
.replace(/\(/g, '%28')
.replace(/\)/g, '%29')
.replace(/!/g, '%21')
.replace(/\*/g, '%2A')
.replace(/~/g, '%7E');
},
getHref = function() {
var href = '';
@thelinuxlich
thelinuxlich / form_analytics.js
Last active June 1, 2016 23:12
form_analytics.js
var actions = {};
$(document).on("submit", ".data-ax-form", function(e) {
if (!$(this).attr("data-ax-submitted")) {
var form_id = $(this).attr("id"),
response = {
total_time_spent: 0,
total_hesitation_time: 0,
most_time_spent_field: 0,
minus_time_spent_field: 0,
@thelinuxlich
thelinuxlich / unload.js
Created November 23, 2015 18:47
Function for executing logic when closing the page/tab or navigating away
var addUnloadEvent = function(unloadEvent, device) {
// device is a object containing parsed user-agent information
var executed = false,
exec = function() {
if (!executed) {
executed = true;
unloadEvent();
}
@thelinuxlich
thelinuxlich / main.html
Created September 30, 2015 18:57
vue new syntax
<div>
<header v-show="skey" v-cloak>
<ul id="slide-out" class="side-nav fixed">
<li class="logo">
<img src="http://doc.aidax.com.br/images/logo.png" width="160" height="70">
</li>
<li :class="{active: current_view === 'metrics'}"><a class="waves-effect waves-teal" href="#!" @click="set_route('metrics')">Métricas</a></li>
<li :class="{active: current_view === 'data'}"><a class="waves-effect waves-teal" href="#!" @click="set_route('data')">Dados</a></li>
<li :class="{active: current_view === 'actions'}"><a class="waves-effect waves-teal" href="#!" @click="set_route('actions')">Ações</a></li>
<li :class="{active: current_view === 'profiles'}"><a class="waves-effect waves-teal" href="#!" @click="set_route('profiles')">Perfis</a></li>
@thelinuxlich
thelinuxlich / gist:2bd92c25ca358dc16e29
Created August 12, 2015 07:57
log for that swaks test
Aug 12 07:55:05 aidax-mailer-1 haraka[10114]: [NOTICE] [8784A9D0-C9E3-492A-B9BF-F5AF18CDE9ED] [core] connect ip=::1 port=33113 local_ip=:: local_port=2525
Aug 12 07:55:05 aidax-mailer-1 haraka[10114]: [DEBUG] [8784A9D0-C9E3-492A-B9BF-F5AF18CDE9ED] [core] running lookup_rdns hooks
Aug 12 07:55:05 aidax-mailer-1 haraka[10114]: [DEBUG] [8784A9D0-C9E3-492A-B9BF-F5AF18CDE9ED] [core] running connect hooks
Aug 12 07:55:05 aidax-mailer-1 haraka[10114]: [PROTOCOL] [8784A9D0-C9E3-492A-B9BF-F5AF18CDE9ED] [core] S: 220 mail.aidax.com.br ESMTP Haraka 2.6.1 ready
Aug 12 07:55:05 aidax-mailer-1 haraka[10114]: [PROTOCOL] [8784A9D0-C9E3-492A-B9BF-F5AF18CDE9ED] [core] C: EHLO aidax-mailer-1.c.confident-topic-837.internal state=1
Aug 12 07:55:05 aidax-mailer-1 haraka[10114]: [DEBUG] [8784A9D0-C9E3-492A-B9BF-F5AF18CDE9ED] [core] running ehlo hooks
Aug 12 07:55:05 aidax-mailer-1 haraka[10114]: [DEBUG] [8784A9D0-C9E3-492A-B9BF-F5AF18CDE9ED] [core] running capabilities hooks
Aug 12 07:55:05 aidax-mailer-1 haraka[10114]: [DEBUG] [87
=== Trying localhost:2525...
=== Connected to localhost.
<- 220 mail.aidax.com.br ESMTP Haraka 2.6.1 ready
-> EHLO aidax-mailer-1.c.confident-topic-837.internal
<- 250-mail.aidax.com.br Hello localhost.localdomain [::1], Haraka is at your service.
<- 250-PIPELINING
<- 250-8BITMIME
<- 250-SIZE 500000
<- 250-STARTTLS
<- 250 AUTH LOGIN CRAM-MD5
; defaults host=localhost port=24
tls
auth/flat_file
dkim_sign
queue/lmtp
rcpt_to.in_host_list