Skip to content

Instantly share code, notes, and snippets.

View despo's full-sized avatar
🌈

Despo Pentara despo

🌈
View GitHub Profile
package ca.jbrains.pos.test;
import static org.junit.Assert.*;
import java.util.*;
import org.junit.*;
public class SellOneItemTest {
public static class Sale {
@despo
despo / zsh-theme
Created February 20, 2011 13:43
terminal prompt
local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})"
PROMPT='%{$fg[blue]%}[%{$reset_color%}${smiley}%{$fg[blue]%}]%{$reset_color%} %{$fg_bold[green]%}%p%{$fg[cyan]%}%{$fg_bold[yellow]%}%{$fg_bold[yellow]%} % %{$fg_bold[yellow]%}➜ %{$reset_color%} '
# git
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%} %{$fg_no_bold[yellow]%}%B"
ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%} %{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=" "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗"
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}✈"
class Configuration
attr_accessor :tail_logs, :max_connections, :admin_password
def app_server
@app_server ||= AppServer.new
yield(@app_server) if block_given?
@app_server
end
@despo
despo / hack.sh
Created March 31, 2012 11:01 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
export JRUBY_OPTS="--1.9"
export JAVA_OPTS='-Xmx1024m -Xms256m -Xss1024k -d32'
# d32 - the JVM defaults to 64-Bit Server VM, which has a faster runtime but will give you great runtime performance but very slow start time
heroku keys:add # what is says
@despo
despo / gist:2310750
Created April 5, 2012 12:35
Sum of all lines in awk
awk '{s+=$1} END { print s}' <filename>
@despo
despo / gist:2311952
Created April 5, 2012 15:27
Fix `time` in zsh
export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S'
@despo
despo / gist:2942468
Created June 16, 2012 20:41
Greek for vim
" vim in Greek
map σ s
map ε e
map ρ r
map τ t
map υ y
map θ u
map ι i
map ο o
map π p
@despo
despo / .vimrc.disable_arrows
Created July 15, 2012 13:17
no arrow keys please
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>