Skip to content

Instantly share code, notes, and snippets.

@anderson-mota
anderson-mota / gist:5467725
Created April 26, 2013 14:26
Helper do Handlebars para quebrar a linha da tabela a cada 4 loops do array.
helperIf: function(){
Handlebars.registerHelper('modules', function(count, options){
if (count % 4 === 0 && count != 0) {
return options.fn(this);
}
});
},
/* Exemplo
<tr>
<?php
/**
* Created by JetBrains PhpStorm.
* User: anderson.mota
* Date: 6/17/13
* Time: 4:59 PM
*
* @author Anderson Mota <[email protected]>
*/
/*
* This Class serializeTo
* Return dataserialize object, array or string
* @author Gustavo da Silva Rodrigues <[email protected]>
*/
;(function ( $, window, document, undefined ) {
var pluginName = "serializeTo",
/**
* default Configuration
/**
* Referências caso necessário
* http://copacocacola.terra.com.br/infografico/dribles/info-dribles/js/info.js
*/
var facebook = (function() {
var share =function(data, type) {
type = type ? type : 'feed';
FB.ui({
@anderson-mota
anderson-mota / gist:6466165
Created September 6, 2013 16:20
Setting Http Server
import sys
from SimpleHTTPServer import SimpleHTTPRequestHandler
import BaseHTTPServer
def test(HandlerClass=SimpleHTTPRequestHandler,
ServerClass=BaseHTTPServer.HTTPServer):
protocol = "HTTP/1.0"
host = ''
@anderson-mota
anderson-mota / compile-handlebars.js
Created October 30, 2013 19:16
Carrega um template e compila com Handlebars
/**
* Carrega um template e compila com Handlebars
* @param {string|Function} path
* @param {Function=} complete
* @returns {Function}
*/
$.fn.templateCompile = function(path, complete){
if(typeof path == 'function' || path == undefined){
if(path != undefined){
@anderson-mota
anderson-mota / Call FullCalendar
Last active June 11, 2024 13:41
Inicializa o plugin Full Calendar e traduz a nomenclatura de datas para o formato ptBr.
function loadCalendar(eventSources){
$('#calendar').fullCalendar({
monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro',
'Outubro', 'Novembro', 'Dezembro'],
monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Aug', 'Set', 'Out', 'Nov', 'Dez'],
dayNames: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
titleFormat: {
month: 'MMMM yyyy',
@anderson-mota
anderson-mota / SassMeister-input.scss
Created February 11, 2014 03:20
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.3)
// Compass (v1.0.0.alpha.18)
// ----
$container-width: 980px;
$columns-total-grid: 12;
$columns-margin: 10px;
$class-row: "row";
$class-columns: "columns";
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%an <%ae>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@anderson-mota
anderson-mota / Gruntfile.js
Created August 18, 2014 14:34
Gruntfile com algumas tarefas: Compass, Ugrify, Connect, Livereload, Bower Install.
/**
* Created by Mota on 10/08/2014.
*/
module.exports = function(grunt) {
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};