Skip to content

Instantly share code, notes, and snippets.

View diego-aslz's full-sized avatar
🏠
Working from home

Diego Selzlein diego-aslz

🏠
Working from home
View GitHub Profile
@diego-aslz
diego-aslz / modal_dialog_helper.rb
Created October 23, 2013 12:09
Bootstrap Helpers for Rails.
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)
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)
@diego-aslz
diego-aslz / map.rb
Created September 9, 2013 17:55
How does the `&:name` parameter work?
cities = City.all
cities.map(&:name) # ['City 1', 'City 2']
@diego-aslz
diego-aslz / .bashrc
Last active December 19, 2015 04:59
Some good aliases for SVN.
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"
}
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));
}