7. ● (CTRL - a) Begin of line
● (CTRL - e) End of line
● (ESC + b) Backward one word
● (ESC + L) Forward one word
● (CTRL - s) Search
● (CTRL - r) Reverse search
● (CTRL - p) Previous line history
R
8.
9. ● alias vim=nvim
● alias be='bundle exec'
● alias bi='bundle install'
● alias g!="git commit -am"
● alias g+="git add"
● alias g-="git rm"
M
10. kill $(ps aux | grep 'rails' | awk '{print $2}')
function k9(){
kill $(ps aux | grep $1 | awk '{print $2}')
}
k9 rails
B f
11. !! -> last line
!$ -> last parameter
$! -> first function argument
$* -> all function arguments
B
23. require 'new_relic/agent/method_tracer'
class Transformer
include ::NewRelic::Agent::MethodTracer
…
def select_events
…
end
def process_events
…
end
def update_events
…
end
add_method_tracer :select_events, 'Custom/select_events'
add_method_tracer :process_events, 'Custom/process_events'
add_method_tracer :update_events, 'Custom/update_events'
end
24. require 'benchmark'
class Updater
...
def update
...
end
...
end
class NewUpdater
def update
...
end
...
end
...
Benchmark.bm do |x|
x.report("New Updater") { NewUpdater.new.load(events);nil }
x.report("Actual Updater") { Updater.new.load(events);nil }
end
25. $ ruby bench_update_events.rb
user system total real
Actual Updater: 1.533333 0.016667 1.550000 ( 1.503462)
New Updater: 1.050000 0.000000 1.050000 ( 0.735473)
26. ● IRB and Pry (Jônatas)
● Code search (Parazito)
27. with `ag` and `grep`
● Basic usage
● Search in a specific file
● Search the current directory for
all files
● Recursively search directories
● Insensitive case
● Highlight match with color
● Number of occurrences in a file
● grep and regex
● curl and grep
@parazito