Skip to content

Instantly share code, notes, and snippets.

View egermano's full-sized avatar
🏠
Working from home

Bruno Germano egermano

🏠
Working from home
View GitHub Profile
@egermano
egermano / README.md
Last active December 28, 2015 05:39
Responsive Hide, for AngularJS

Responsive Hide.

Hide a element based on a breakpoint.

Usage

 <div class="recipe" ng-repeat="(index, recipe) in recipes" responsive-hide="{{ (288 * (index+1)) }}" responsive-hide-watch="recipes">
      ...
 </div>
@egermano
egermano / gist:7240614
Created October 30, 2013 21:28
Validação de digitação de campos de texto. Valida apenas letras, números, undescore, ífen, ponto, um arroba seguido e um espaço seguido.
$('#form-email').unbind('keypress.pogMask').bind('keypress.pogMask', function(e){
return !!String.fromCharCode(e.keyCode).match(/^[a-z0-9_@\-\. ]+$/gi);
}).unbind('keyup.pogMask').bind('keyup.pogMask', function(){
$(this).val($(this).val().replace(/@{2,}/g, '@'));
$(this).val($(this).val().replace(/\s{2,}/g, ' '));
});
@egermano
egermano / gist:7240592
Created October 30, 2013 21:27
Validação de digitação de campos de texto. Valida apenas letras e um espaço seguido.
$('#form-name, #form-surname').unbind('keypress.pogMask').bind('keypress.pogMask', function(e){
return !!String.fromCharCode(e.keyCode).match(/^[a-z ]+$/gi);
}).unbind('keyup.pogMask').bind('keyup.pogMask', function(){
$(this).val($(this).val().replace(/\s{2,}/g, ' '));
});
@egermano
egermano / pre-commit
Created July 24, 2013 16:48
geocommit save my geoloxalization ever commit
#!/usr/bin/env ruby
require 'socket'
=begin
Current workflow...
Geomit opens (TCP Server loads)
Pre-commit hook triggers
Pre-commit opens CWD/contributors.geojson
if something
Pre-commit hook sends CWD/contributors.geojson and hangs
@egermano
egermano / jQuery.validator.cpf.js
Created June 20, 2013 19:28
Validator Algorithm for jQuery Validator Plugin
//validação do formulario
jQuery.validator.addMethod("cpf", function(value, element) {
log("jquery.validator CPF", value);
var cpf = value.replace(/\./g,'').replace(/\-/,'');
var numeros, digitos, soma, i, resultado, digitos_iguais;
digitos_iguais = 1;
if (cpf.length < 11)
@egermano
egermano / pre-commit.sound
Created June 20, 2013 15:43
git commit sound
#!/bin/sh
afplay -v 0.1 /System/Library/Sounds/Tink.aiff > /dev/null 2>&1
@egermano
egermano / post-commit.sound
Created June 20, 2013 15:40
Play sound on commit
#!/bin/sh
afplay -v 0.1 /System/Library/Sounds/Pop.aiff > /dev/null 2>&1
@egermano
egermano / pre-push
Last active December 18, 2015 03:08
Solicitação de Deploy por ftp... Abre o Trasnmit...
#!/bin/sh
terminal-notifier -message "Pra abrir o Transmit para fazer é só clicar aqui!" -title "Vai fazer deploy?" -group 1911 -execute "open /Applications/Transmit.app/"
@egermano
egermano / post-commit
Last active December 18, 2015 02:58
Post commit com frasees do Marvin do Guia
#!/usr/bin/env python
# coding=utf-8
# -*- coding: utf-8 -*-
import os
import random
marvin = [
"DON'T PANIC!",
"Ah, a vida. Pode-se odiá-la ou ignorá-la, mas é impossível gostar dela.",
vendor(prop, args)
-webkit-{prop} args
-moz-{prop} args
-ms-{prop} args
-o-{prop} args
{prop} args
border-radius()
vendor('border-radius', arguments)