Skip to content

Instantly share code, notes, and snippets.

View leoluz's full-sized avatar

Leonardo Luz Almeida leoluz

View GitHub Profile
@leoluz
leoluz / StubMappingWithScenarioJsonRecorder.groovy
Created January 13, 2016 21:05
A Wiremock listener implementation that records stubs with scenarios allowing you to playback your tests even in complex scenarios that depends on state transitions awareness.
import com.github.tomakehurst.wiremock.common.FileSource
import com.github.tomakehurst.wiremock.common.IdGenerator
import com.github.tomakehurst.wiremock.common.UniqueFilenameGenerator
import com.github.tomakehurst.wiremock.common.VeryShortIdGenerator
import com.github.tomakehurst.wiremock.http.*
import com.github.tomakehurst.wiremock.matching.RequestPattern
import com.github.tomakehurst.wiremock.matching.ValuePattern
import com.github.tomakehurst.wiremock.stubbing.Scenario
import com.github.tomakehurst.wiremock.stubbing.StubMapping
@leoluz
leoluz / git_latest_tag_name
Created June 10, 2014 17:46
[git] return the latest tag name created in the repo
git for-each-ref --count=1 --sort=-taggerdate --format='%(refname:short)'
@leoluz
leoluz / gist:9087940
Created February 19, 2014 08:13
search for a string in jar/zip files
sudo find libdir/ -name "*.jar" -exec zipgrep -n "Your String Here" '{}' \;
@leoluz
leoluz / gist:6318789
Created August 23, 2013 12:29
pricerow impex
$catalogVersion=catalogVersion(catalog(id[default='electronicsProductCatalog']),version[default='Online'])[unique=true,default='electronicsProductCatalog:Online']
INSERT_UPDATE PriceRow;$catalogVersion;unit(code);price;currency(isocode)[unique=true];channel(code)[unique=true];product(code,$catalogVersion)[unique=true]
;;pieces;20.00;USD;;107701
;;pieces;12.34;USD;"mobile";107701
;;pieces;15.00;USD;"desktop";107701
@leoluz
leoluz / tab_remove.sh
Created June 15, 2012 15:45
Remove tab character from files
expand -t 4 "$1" > /tmp/expand.tmp
mv /tmp/expand.tmp "$1"
@leoluz
leoluz / grepSVNRepo.sh
Created June 15, 2012 15:34
How to grep a svn repo ignoring .svn files
find . -not \( -name *.svn -prune \) -type f -exec grep -ril HelloWorld {} \;
@leoluz
leoluz / remove_svn_dirs
Created August 12, 2010 20:19
Search and remove all .svn dirs from a local subversion repo
find . -type d -name .svn -exec rm -rf {} \;
@leoluz
leoluz / gae_guestbook.py
Created May 30, 2010 00:53
google app engine quick example
import cgi
from google.appengine.ext import db
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class Greeting(db.Model):
author = db.UserProperty()
content = db.StringProperty(multiline=True)
http://wiki.locaweb.com.br/pt-br/Usando_GIT_na_Hospedagem_Linux
<property name="connection.datasource">jdbc/MeuDataSource</property>