Skip to content

Instantly share code, notes, and snippets.

View rodrigo-galba's full-sized avatar

Rodrigo Galba rodrigo-galba

  • Brazil
View GitHub Profile
@rodrigo-galba
rodrigo-galba / gist:4521817
Created January 13, 2013 02:01
Gradle create app directories
task createDirs << {
webAppDir.mkdirs()
sourceSets.all {
allSource.srcDirs.each {
it.mkdirs()
}
}
}
@rodrigo-galba
rodrigo-galba / gist:4436787
Created January 2, 2013 18:43
Disable windows beep from console
sc stop beep && sc config beep start= disabled
@rodrigo-galba
rodrigo-galba / gist:4224045
Created December 6, 2012 12:16
GitBash to Console2
Console2 config To use git bash on it:
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
@rodrigo-galba
rodrigo-galba / gist:4058942
Created November 12, 2012 11:52
Rest assured with cucumber step definitions
public class TransformationStepdefs {
private RequestSpecification spec = RestAssured.with();
@Given("^I have a single \"([^\"]*)\" file$")
public void I_have_a_single_file(String format) throws Throwable {
spec.given().
multiPart("requestData", objectAsJson()).
header("Version", 1);
}
@rodrigo-galba
rodrigo-galba / gist:3988356
Created October 31, 2012 17:07
RS-Server stand-alone
public class ServerApp {
private Server server;
public static void main(String[] args) {
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(new String[] {"restapp.xml"});
MyService previewService = (MyService) appContext.getBean("MyService");
new ServerApp().start("http://localhost:9000/", previewService, Response.class);
System.exit(0);
}
instalar counter strike source no mac (multiplayer working):
- baixar counter strike source cider port(eu baixei do demonoid http://www.demonoid.com/files/details/1897279/51062454/ 3.13gb)
- baixar http://css.setti.info/servers/masterserver/
- control+click no ícone do Counter Strike depois de montar o dmg >"Show Contents"
- entra em Contents>Resources>Transgaming>c_drive>program Files>css>platform>config
- renomear o MasterServers.vdf pra MasterServers.vdf_bkp (se quiser restaurar depois)
- copiar o arquivo de servers(MasterServers.vdf) que vc fez download para essa pasta
- command+i com o MasterServers.vdf selecionado e altera pra readonly o arquivo (se não o jogo altera para os servers da Valve)
- have fun :)
@rodrigo-galba
rodrigo-galba / gist:3783721
Created September 25, 2012 18:53
Biblioteca
Local/Site
http://www.casadocodigo.com.br
- Aplicações Java para a web com JSF e JPA
- Test-Driven Development: Teste e Design no Mundo Real
- HTML5 e CSS3: Domine a web do futuro
- Vire o jogo com Spring Framework
http://www.novatemporeal.com.br
@rodrigo-galba
rodrigo-galba / gist:3361975
Created August 15, 2012 17:59
jQuery antipatterns
Alguns 'anti-padrões' catalogados. Solucões postarei futuramente.
1 - selectors dinamicos
ex: '#div_produto_${codigo}'
Neste caso, muitos devs esperam que o código seja renderizado para só então aplicar um evento naquele componente.
2 - Validação de forms na função submit.
ex: $("#form_salvar_bobina").submit(function() {
//validação aqui ...
@rodrigo-galba
rodrigo-galba / gist:3090444
Created July 11, 2012 13:46
methods? for JavaScript
// implementation of the method 'methods' exists in Ruby to JavaScript
// in this case, only the methods included in 'Object' will appear
// lack the methods of the type that inherits from 'Object'
Object.prototype.methods = function() {
var mets = [];
for(i in this) {
if (typeof this[i] === 'function')
mets.push(i);
}
@rodrigo-galba
rodrigo-galba / gist:2924998
Created June 13, 2012 16:05
Começando com GIT
# anotações sobre screencast sobre Git
Topicos - Tempo
. Instalação do git, conceituação de DVCS, exemplos de VCS existentes, configurações do git, criando um repo
. Estrutura de um commit (43:00)
# SHA-1 é melhor que MD5. Porque? SHA-1 checa a integridade do conteudo recebido na operação de digest
# video parado em 50:13'