Skip to content

Instantly share code, notes, and snippets.

View caiotarifa's full-sized avatar
💻
Coding...

Caio Tarifa caiotarifa

💻
Coding...
View GitHub Profile
var BigCoffee = function(selector) {
var elements = document.querySelectorAll(selector),
index = 0;
if (this === window) {
return new BigCoffee(selector);
}
for (; index < elements.length; index++) {
this[index] = elements[index];
var Sticky = function(selector, containerSelector) {
var element = document.querySelector(selector),
containerElement = document.querySelector(containerSelector),
elementTop = parseInt(window.getComputedStyle(element, null).marginTop),
stickedClass = 'sticked',
grabEndClass = 'grab-end',
elementStart, containerElementFinish;
@caiotarifa
caiotarifa / timeago.js
Last active April 7, 2021 21:30
"Distance of Time in Words" in Vanilla JavaScript.
var TimeAgo = (function() {
var self = {};
// Public Methods
self.locales = {
prefix: '',
sufix: 'ago',
seconds: 'less than a minute',
minute: 'about a minute',
@caiotarifa
caiotarifa / TimeTrello.rb
Last active March 15, 2016 12:49
TimeTrello: Simple time tracking with Trello & Ruby.
require 'trello'
# Key & Token
TRELLO_DEVELOPER_PUBLIC_KEY = ''
TRELLO_MEMBER_TOKEN = ''
# General
BOARD_ID = ''
PREFIX = ':clock12: '
function sendPayment() {
var sheet, last, prices, person;
function getColumnByLastRow(column) {
return sheet.getRange(last.row, column).getValue().toString();
}
sheet = SpreadsheetApp.getActiveSheet();
last = {
var Application = (function(parent, $, window, document, undefined) {
'use strict';
var self = parent.module = parent.module || {};
function privateExample() {
return false;
}
self.publicExample = function() {
@caiotarifa
caiotarifa / dispatcher.js
Created September 3, 2015 22:10
Vanilla JavaScript Dispatcher
var Dispatcher = (function() {
'use strict';
var route, namespaceName, controllerName, controller, actionName, action;
function capitalize(string) {
return string.charAt(0).toUpperCase() + string.substring(1);
}
route = $('body').data('route').split('#');
@caiotarifa
caiotarifa / template.js
Created September 2, 2015 19:09
Lightweight JavaScript Templating Engine
var Template = (function (selector) {
'use strict';
function render(data) {
var node = this.node;
if (data) {
for (var variable in data) {
node = node.split('{{' + variable + '}}').join(data[variable]);
}
@caiotarifa
caiotarifa / wpcf7_send_to_mailchimp.php
Last active February 11, 2023 17:44
CONTACT FORM 7 -> MAILCHIMP 3.0
<?php
// -------------------------------------------------------------------------- //
// CONTACT FORM 7 -> MAILCHIMP //
// -------------------------------------------------------------------------- //
// © 2015 Caio Tarifa. All Rights Reserved. //
// -------------------------------------------------------------------------- //
function wpcf7_send_to_mailchimp() {
@caiotarifa
caiotarifa / .scss-lint.yml
Last active August 29, 2015 14:24
My SCSS Lint
linters:
EmptyLineBetweenBlocks:
enabled: true
ignore_single_line_blocks: false
HexLength:
enabled: true
style: long
LeadingZero: