This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package factj.test; | |
import factj.FactJ; | |
public class Application { | |
public static void main(String[] args) { | |
PersonFabricator.load(); | |
System.out.println(FactJ.build(Person.class)); | |
System.out.println(FactJ.build(Person.class)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias svnu='svn up' | |
alias sst='svn stat' | |
alias slog='svn log -l 10' | |
alias scm='svn commit -m' | |
alias sme='svn merge' | |
alias sdf='svn diff | vim -' | |
svs() { | |
svn stat | grep -v "classpath" | grep -v "/bin" | grep -v ".settings" | grep -v ".project" | grep -v "target" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cities = City.all | |
cities.map(&:name) # ['City 1', 'City 2'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload colors && colors | |
# cheers, @ehrenmurdick | |
# http://github.com/ehrenmurdick/config/blob/master/zsh/prompt.zsh | |
git_branch() { | |
echo $(/usr/bin/git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'}) | |
} | |
git_dirty() { | |
st=$(git status -sb 2>/dev/null | wc -l) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ModalDialogHelper | |
def modal_dialog(options={},&block) | |
content_tag :div, {class: 'modal hide fade', tabindex: -1, role: 'dialog'}.merge(options), &block | |
end | |
def modal_header(options={},&block) | |
content_tag :div, {class: 'modal-header'}.merge(options), &block | |
end | |
def modal_body(options={},&block) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.clouded.web.service.support; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.HttpStatus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding : utf-8 -*- | |
puts "Cities..." | |
City.transaction do | |
ro = Province.find_by_uf('RO') | |
City.create(province_id: ro.id, id: '1100015', lat: -11.9284, lng: -61.9951, name: 'Alta Floresta D\'Oeste') | |
City.create(province_id: ro.id, id: '1100023', lat: -9.91375, lng: -63.044, name: 'Ariquemes') | |
City.create(province_id: ro.id, id: '1100031', lat: -13.4864, lng: -60.5411, name: 'Cabixi') | |
City.create(province_id: ro.id, id: '1100049', lat: -11.4315, lng: -61.4477, name: 'Cacoal') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Essa função você nao precisa, use-a só para ver como a classe é instanciada, pode instanciar direto a impressora USB. | |
// Esse objeto Configuracoes lê de um arquivo INI, vc pode, em vez de usar algo assim, passar a porta fixa. No caso da USB, a impressora vai procurar sozinha todas as portas COM caso a que você passou não funcione. | |
function ObterImpressora: TImpressora; | |
begin | |
if Configuracoes.TipoImpressora = tiSerial then | |
begin | |
Impressora.Porta := Configuracoes.Porta; | |
Result := Impressora; | |
end | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
public class DomainClass { | |
public void doSomething(Object arg0, Proc block) { | |
// do something | |
block.run(arg0); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ `whoami` == "root" ]]; then | |
echo "Você está logado como root. Por favor, execute este comando com seu próprio usuário." | |
exit 1 | |
fi | |
sudo apt-get install git -y | |
git clone [email protected]:dsis/dotfiles.git ~/.dotfiles && cd ~/.dotfiles && script/bootstrap |
OlderNewer