Skip to content

Instantly share code, notes, and snippets.

View lucastex's full-sized avatar

Lucas Frare Teixeira lucastex

View GitHub Profile
@lucastex
lucastex / pipeHook.js
Last active August 29, 2015 14:16 — forked from Marak/pipeHook.js
Pipe Hooks into each other
module['exports'] = function pipeHook (hook) {
hook.debug('Opening echo hook with some data');
var hook2 = hook.open('http://hook.io/Marak/echo?foo=bar');
hook2.write('hello!');
hook2.pipe(hook.res);
};
@lucastex
lucastex / grails_twitter.groovy
Created March 3, 2009 02:47
Using Grails Twitter plugin to update your status
def twitterService
(...)
def updateTwitterStatus = {
twitterService.setStatus "My new status..." //probably would be something like params.newStatus
redirect action: index //or your usual action
}
class Empresa {
String razaoSocial
String cnpj
static constraints = {
razaoSocial()
cnpj(cnpj:true)
}
}
class Pessoa {
String nome
String cpf
static constraints = {
nome()
cpf(cpf:true)
}
}
class Pessoa {
String nome
String cpf
static constraints = {
nome()
cpf(cpf:[formatted:true])
}
}
class Empresa {
String razaoSocial
String cnpj
static constraints = {
razaoSocial()
cnpj(cnpj:[formatted:true])
}
}
class Pessoa {
String nome
String nit
static constraints = {
nome()
nit(nit:[formatted:true])
}
}
class Pessoa {
String nome
String nit
static constraints = {
nome()
nit(nit:true)
}
}
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
import java.util.zip.*
import org.tmatesoft.svn.core.internal.io.dav.*
import org.tmatesoft.svn.core.wc.*
import org.tmatesoft.svn.core.*
@Grab(group='com.svnkit', module='svnkit', version='1.1.0')
def setup(projectName) {
File.metaClass.plus = { String c -> new File(delegate, c) }