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 / post-commit
Created November 22, 2012 18:08
gitshots
#!/usr/bin/env ruby
file="~/Dropbox/Photos/gitshots/#{Time.now.to_i}.jpg"
puts "Taking capture into #{file}!"
system "imagesnap -q -w 3 #{file}"
exit 0
@egermano
egermano / post-receive
Created January 22, 2013 16:09
simple git deploy
#!/bin/sh
#path to project on server
GIT_WORK_TREE=/var/www/path/to/project/ git checkout -f
@egermano
egermano / post-receive
Created January 22, 2013 16:10
git deploy with stylus
#!/bin/sh
#path to project on server
GIT_WORK_TREE=/var/www/path/to/project/ git checkout -f
# other instructions on deploy
cd /var/www/path/to/project
# Compile Stylus
stylus --include /usr/local/lib/node_modules/nib/lib app/static/style/main.styl
stylus app/static/style/tab.styl
@egermano
egermano / post-update
Created January 22, 2013 16:12
git deploy stage or in diferente branch than master
#!/bin/sh
export GIT_DIR=$(pwd)
cd /var/www/path/to/server/
git checkout -f master
git checkout -f developer
vendor(prop, args)
-webkit-{prop} args
-moz-{prop} args
-ms-{prop} args
-o-{prop} args
{prop} args
border-radius()
vendor('border-radius', arguments)
@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.",
@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.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-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 / 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)