-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·455 lines (399 loc) · 14.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Console Tricks & Entwickler Shortcuts</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/moon.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/railscasts.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<style>
.hljs{
background: #011c23;
}
/*@import url(../../lib/font/source-sans-pro/source-sans-pro.css);*/
.reveal h1 {
font-size: 2.5em;
}
.reveal h2 {
font-size: 1.6em;
}
.reveal h3 {
font-size: 1.3em;
}
.reveal h4 {
font-size: 1.0em;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1 style='position:relative'>Console Tricks</h1>
<div style='opacity: 0.5; margin: -50px 0 -30px; font-size: 2em; font-family: "League Gothic"'>&</div>
<h1>Entwickler Shortcuts<div class='emoji' style='font-size:80%;position:absolute; bottom:50px; right: 70px'>⚡</div></h1>
</section>
<section data-background-color="rgb(222, 222, 221)">
<img data-src="img/pry_logo.png" style="background:none; border:none; box-shadow:none">
</section>
<section>
<p><em>... wie war es nochmal?</em></p>
<img data-src="img/futurama-professor-farnsworth.jpg">
</section>
<!-- HISTORY ---------------------------------------------------------------------------------------->
<section>
<section>
<h1>Verlauf <img data-src="img/history.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h1>
</section>
<section>
<h3>fuzzy finder</h3>
<a href="https://github.com/junegunn/fzf" target="_blank">https://github.com/junegunn/fzf</a>
<img data-src="img/fuzzy.gif">
</section>
<section>
<h3>history</h3>
<pre><code class="hljs" data-trim contenteditable>
hist (history)
hist --all (-a)
hist -T (--tail) 20
hist -G (--grep) (REGEX)
hist -r (--replay) 14..16
hist -n (--no-numbers)
# "hh", "hist -a -T30"
# "hn", "hist -a -T30 -n"
# "hg", "hist -a -G"
# "hr", "hist -a -r"
# CTRL + R
</code></pre>
</section>
</section>
<!-- COPY ---------------------------------------------------------------------------------------->
<section>
<section>
<h1>Copy/Paste <img data-src="img/clipboard.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h1>
</section>
<section>
<h3>Verkleinerung der Schriftgröße</h3>
<table>
<tbody>
<tr>
<td style='width: 50%; vertical-align: top'><img data-src="img/long-output-0.png"></td>
<td style='width: 50%; vertical-align: top'><img data-src="img/long-output-2.png"></td>
</tr>
</tbody>
</table>
</section>
<section>
<h3>pbcopy / pbpaste</h3>
<pre><code class="hljs" data-trim contenteditable>
foo = '123'
`echo #{foo} | pbcopy`
`echo #{ISO3166::Country.all} | pbcopy` ❌
IO.popen('pbcopy', 'w') { |f| f << ISO3166::Country.all }
bar = `pbpaste`
</code></pre>
</section>
<section>
<h3>Pry-Clipboard</h3>
<pre><code class="hljs" data-trim contenteditable>
# gem 'pry-clipboard'
Clipboard.copy Array.methods
foo = Clipboard.paste
# "cc", "copy-history -T -2 -l" # input und output
</code></pre>
</section>
<section>
<table>
<thead>
<tr>
<th>sublime</th>
<th>copy-clip</th>
</tr>
</thead>
<tbody>
<tr>
<td style='vertical-align: top'><img data-src="img/sublime_clipboard.png"></td>
<td><img data-src="img/copy_clip.png"></td>
</tr>
</tbody>
</table>
</section>
</section>
<!-- OUTPUT ---------------------------------------------------------------------------------------->
<section>
<section>
<h1>Output <img data-src="img/sign-out.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h1>
</section>
<section>
<h3>Darstellungsmöglichkeiten</h3>
<ul>
<li><code>puts #foo.to_s</code></li>
<li><code>p #foo.inspect</code></li>
<li><code>pp # pretty print</code></li>
<li><code>j/jj # pretty json</code></li>
</ul>
</section>
<section>
<h3>Tabellarische Daten</h3>
<pre><code class="ruby hljs" data-trim contenteditable>
_table Question.limit(5), fields: %i(id questionnaire_id text)
+----+------------------+-------------------------------------+
| id | questionnaire_id | text |
+----+------------------+-------------------------------------+
| 1 | 6 | Iste sint a cumque consectetur. |
| 2 | 7 | Omnis animi ea architecto reicie |
| 3 | 8 | Facere ut nihil nisi eaque praes... |
| 4 | 9 | Eum et incidunt veritatis ut. |
| 5 | 10 | Non voluptatem praesentium sint ... |
+----+------------------+-------------------------------------+
_table [['foo', 'bar', 'baz'], [1,2,3], [4,5,6]]
_table [{foo: '1', bar: '2'}, {foo: '3', bar: '4'}]
_table (1..3).map {|i| i.days.from_now }, :fields=>[:to_s, :year, :month, :day]
</code></pre>
</section>
<section>
<h3>Inspektoren</h3>
<pre><code class="hljs" data-trim contenteditable>
list-inspectors
change-inspector # default, simple, clipped
# custom: awesome, hirb, special_cases
</code></pre>
</section>
<section>
<h3>Inspektoren - Sonderfälle</h3>
<pre><code class="hljs" data-trim contenteditable>
Pry::Inspector::MAP['default_with_special_cases'] = {
description: 'provides extra info for some models',
value: proc do |output, value, _pry_|
case value
when User
puts "\e[34m #{ value.role } #{ value.email } \e[0m\n -------- \n"
end
Pry::DEFAULT_PRINT.call(output, value, _pry_)
end
}
</code></pre>
</section>
</section>
<!-- Prompts ---------------------------------------------------------------------------------------->
<section>
<section>
<h1>Prompt <img data-src="img/angle-double-right.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h1>
</section>
<section>
<h3>prompts</h3>
<pre><code class="ruby hljs" data-trim contenteditable>
list-prompts
change-prompt # simple, nav, none
# custom: rails_app, memory
</code></pre>
</section>
<section>
<h3>Umgebung Prompt</h3>
<img data-src="img/rails_prompt.png" />
</section>
<section>
<h3>Arbeitsspeicher Prompt</h3>
<img data-src="img/memory_prompt.png" />
</section>
</section>
<!-- Colors ---------------------------------------------------------------------------------------->
<section>
<section>
<h1><span style='color: #e6e62d'>Farben</span> <img data-src="img/paint-brush.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h1>
</section>
<section>
<h3>Farbcodes</h3>
<small><a href='http://stackoverflow.com/questions/1489183/colorized-ruby-output' target='_blank'>http://stackoverflow.com/questions/1489183/colorized-ruby-output</a></small>
<img data-src="img/colors.png" style='max-height: 50vh'>
</section>
<section>
<h3>Warnungen</h3>
<pre class="hljs" data-trim contenteditable>
<span>be</span> rails c
<span style='color:red'>The meta-request gem can cause a SystemStackError: stack level
too deep when saving a shop record.
See
https://github.com/rgeo/activerecord-postgis-adapter/issues/81</span>
Loading development environment (Rails 4.2.6)
</pre>
</section>
</section>
<!-- Emoji ---------------------------------------------------------------------------------------->
<section>
<section>
<h1>Emoji! <span class='emoji'>🦄</span></h1>
</section>
<section data-background-image='img/emoji.png'>
</section>
<section data-background-image='img/gravity-falls-gnome-rainbow.png'>
</section>
</section>
<!-- Debugging ---------------------------------------------------------------------------------------->
<section>
<section>
<h1>Debugging <img data-src="img/bug.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h1>
</section>
<section>
<h3>Erkunden</h3>
<pre><code class="ruby hljs" data-trim contenteditable>
show-source
ls
cd
find-method
Foo._tab_autovervollstaendigung</span>
edit -p Foo # $EDITOR
</code></pre>
</section>
<section>
<h3>docs / modelle</h3>
<pre><code class="ruby" data-trim contenteditable>
# gem 'pry-doc'
? Array#reduce (alias show-doc)
show-middleware
show-model
show-models
show-routes
</code></pre>
</section>
<section>
<code>binding.pry</code>
<pre><code class="ruby hljs" data-trim contenteditable>
whereami
caller
# gem 'pry-byebug'
# break, step, next, finish, continue
# backtrace, up, down, frame
</code></pre>
</section>
<section>
<h3>better errors</h3>
<img data-src="img/better_errors.png">
</section>
</section>
<!-- Waiting ---------------------------------------------------------------------------------------->
<section>
<section>
<h1>Warten <img data-src="img/ellipsis-h.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h1>
</section>
<section>
<h3>Benachrichtigungen nach langen Prozessen</h3>
<pre><code class="ruby" data-trim contenteditable>
# gem 'terminal-notifier'
def ping_when_finished(&block)
block.call if block_given?
`say fertig`
`terminal-notifier -message "finished" -sound default -timeout 5`
end
</code></pre>
</section>
<section>
<h3>tqdm</h3>
<small><a href='https://github.com/powerpak/tqdm-ruby' target='_blank'>https://github.com/powerpak/tqdm-ruby</a></small>
<img data-src="img/tqdm.gif" />
</section>
</section>
<section>
<section>
<h1>Konfiguration <img data-src="img/cog.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h1>
</section>
<section>
<h3>.pryrc</h3>
<ul>
<li class='fragment'>isolieren</li>
<li class='fragment'>eingebautes Cheatsheet</li>
</ul>
</section>
</section>
<section>
<section>
<h1 style='font-size:4em'>Abkürzungen <img data-src="img/rocket.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h1>
</section>
<section>
<h3>Find My Dev <img data-src="img/search.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h3>
<pre><code class="hljs" data-trim contenteditable>
module FindMyDev
def fer
self.find_by(first_name: "Fernando", last_name: "Sainz")
end
def important_client
# ....
end
end
User.extend(FindMyDev) if Rails.env.development?
</code></pre>
</section>
<section>
<h3>Find My Dev <img data-src="img/search.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h3>
<pre><code class="hljs" data-trim contenteditable>
User.fer
City.bonn
Company.haribo
# ...
</code></pre>
</section>
<section>
<h3>Dev Tools Leiste <img data-src="img/share-square-o.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h3>
<img data-src="img/dev1.png">
<img data-src="img/dev2.png">
<img data-src="img/dev3.png">
</section>
<section>
<h3>Dev Tools Leiste <img data-src="img/share-square-o.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h3>
<ul>
<li>Routes</li>
<li>Emails</li>
<li>Sidekiq</li>
<li>Styles</li>
<li>Sprachenschalter</li>
<li>Impersonieren / Role Switch</li>
<li>Zeitreisen</li>
</ul>
</section>
<section data-background-image='img/time_travel.jpg'>
</section>
<section>
<section>
<h3>1 click Setup <img data-src="img/magic.svg" style="background:none; border:none; box-shadow:none; max-height: 1em;"></h3>
<img data-src="img/1-click.png" style='max-height: 50vh'>
</section>
</section>
</section>
<section>
<h1>Danke!</h1>
<br/>
<p style="border-top: 1px solid rgba(255,255,255,0.1); padding-top: 30px;">
<strong style='color:rgb(238, 232, 213)'>Fernando Sainz</strong>
fsainz.com
</p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
history: true,
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>