$mod
refers to the modifier key (alt by default)
startx i3
start i3 from command line$mod+<Enter>
open a terminal$mod+d
open dmenu (text based program launcher)$mod+r
resize mode ( or to leave resize mode)$mod+shift+e
exit i3
:vimgrep /pattern/ path/** | |
:cope #to open quickfix list |
xrdb -merge .Xresources |
nmap <F2> :!bin/command.sh<CR> |
__BEGIN__ | |
*vimtips.txt* For Vim version 7.3. | |
------------------------------------------------------------------------------ | |
" new items marked [N] , corrected items marked [C] | |
" *best-searching* | |
/joe/e : cursor set to End of match | |
3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C] | |
/joe/s-2 : cursor set to Start of match minus 2 | |
/joe/+3 : find joe move cursor 3 lines down | |
/^joe.*fred.*bill/ : find joe AND fred AND Bill (Joe at start of line) |
set -e: Enables checking of all commands. If a command exits with an error and the | |
caller does not check such error, the script aborts immediately. Enabling this will | |
make your scripts more robust. But don't wait until your script is "complete" to set | |
the flag as an afterthought, because it will be a nightmare to fix the scrip to work | |
with this feature enabled. Just write set -e as the very first line of your code; | |
well... after the shell bang. | |
set -x: If you are writing simple scripts that are meant to, well, script the execution | |
of a few tasks (as opposed of being full-flown programs written in shell), set this | |
flag to trace the execution of all commands. This will make the interpreter print |
(defn | |
^{:doc "Action that shows the help and about page." | |
:path "/help" | |
:http_method :get} | |
action-show | |
[account member] | |
(normal-layout account | |
[:div | |
[:h1 "Title"] | |
[:p "lorem") |
A little tutorial on mapreduce. | |
This is a short tutorial on what mapreduce is. It'll do a process first sequentially and then with multiple mapper jobs As a silly example we will try to get a list of prime numbers in a big corpus of random numbers. Let's first start out with creating some test data that has good behaviour. We'll do this in the a terminal shell using ruby. | |
$ruby -e "(1..100).each { |x| puts x }" > data_1..100.txt | |
Look at the file with the "cat" utility: | |
$ cat data_1..100.txt | |
1 |
# encoding: utf-8 | |
class SocialSecurityNumber | |
def initialize str | |
if str =~ /(\d{2})(\d{2})(\d{2})(\d{4})/ | |
@str = str | |
@year,@month,@day,@last_four = $1,$2,$3,$4 | |
current_year = Time.now.year % 100 | |
century = @year.to_i > current_year ? "19" : "20" | |
@full_year = "#{century}#{@year}" |
min_messages: WARNING |