Skip to content

Instantly share code, notes, and snippets.

View kiero's full-sized avatar

Konrad Kierys kiero

View GitHub Profile
= form_tag({:controller => :sessions, :action => :update}, :method => :post, :class => 'well')
<form accept-charset="UTF-8" action="/assets?action=update&amp;controller=admin%2Fsessions" class="well" method="post">
def index
years = Movie.select("strftime('%Y', release)").group("strftime('%Y', release)").count
grouped = {}
years.each do |k,v|
grouped[k] = Movie.where("strftime('%Y', release) = ?", k)
end
@years = grouped
end
@kiero
kiero / Gitattributes for Xcode projects
Created July 24, 2011 00:33
.gitignore & .gitattributes for Xcode projects
# excludes this file from merges
# treats it like binary file
*.pbxproj -crlf -diff -merge
@kiero
kiero / gitignore_global
Created July 12, 2011 17:05
Git ignore global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@kiero
kiero / gitconfig
Created July 12, 2011 17:04
Git global configuration
[user]
name = Konrad Kierys
email = <mail here>
[core]
excludesfile = /Users/kiero/.gitignore_global
editor = vim
autocrlf = input
safecrlf = true
[color]
ui = true
@kiero
kiero / vimrc
Created July 12, 2011 16:58
Vim configuration
set nocompatible " no compatible with vi
let mapleader=',' " change the mapleader form \ to ,
map <Leader>n :NERDTreeToggle<CR>
filetype plugin indent on
set hidden " hide buffer instead of closing it
set encoding=utf-8
set number " show line numbers
set tabstop=2 " tab is two spaces now
@kiero
kiero / twd
Created May 5, 2011 15:57
Script for opening a current working directory in another tab in terminal
#!/bin/sh -
if [ $# -ne 1 ]; then
PATHDIR=`pwd`
else
PATHDIR=$1
fi
/usr/bin/osascript <<-EOF
activate application "Terminal"