From: Charles McGarvey Date: Fri, 8 Jun 2018 05:35:40 +0000 (-0600) Subject: initial commit X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftalk-level-up-your-perl;a=commitdiff_plain;h=de803521052265c492f81daf0c6a3e78c1b5309d initial commit --- de803521052265c492f81daf0c6a3e78c1b5309d diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..846365e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/img/basic-flow*svg +/remark.min.js +/slides-offline.html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d42558c --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ + +SLIDES = level-up-your-perl +BROWSER = google-chrome +DOT = dot + +dotfiles = $(shell find . -iname '*.dot') +svgfiles = $(patsubst %.dot,%.svg,$(dotfiles)) + +all: offline + +clean: + rm -f slides-offline.html remark.min.js $(SLIDES).pdf $(svgfiles) + +offline: slides-offline.html remark.min.js $(svgfiles) + +pdf: $(SLIDES).pdf + +run: $(svgfiles) + $(BROWSER) slides.html + +run-offline: offline + $(BROWSER) slides-offline.html + +%.svg: %.dot + $(DOT) -Tsvg -o$@ $< + +$(SLIDES).pdf: slides.html $(wildcard css/*) $(wildcard img/*) $(svgfiles) + docker run --rm -v `pwd`:/pwd astefanutti/decktape /pwd/slides.html /pwd/$(SLIDES).pdf + +slides-offline.html: slides.html + sed -e '1 a ' \ + -e 's!https://.*remark-latest\.min\.js!remark.min.js!' <$< >$@ + +remark.min.js: + curl -Lo $@ https://gnab.github.io/remark/downloads/remark-latest.min.js + +.PHONY: all clean offline pdf run run-offline + diff --git a/README.md b/README.md new file mode 100644 index 0000000..d831e75 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ + +# Slides for "Level up your Perl" + +This directory contains the slides for my talk entitled "Level up your Perl". + +The slides were written in [Markdown](https://daringfireball.net/projects/markdown/) format and can be rendered with +[remark](http://remarkjs.com/). + +## Options + +To view the slides: + + make run + +To build a PDF version of the slides: + + make pdf + diff --git a/abstract.txt b/abstract.txt new file mode 100644 index 0000000..8540c90 --- /dev/null +++ b/abstract.txt @@ -0,0 +1,17 @@ + +# Level up your Perl + +We're all at different places along our path toward ultimate Perl Mastery, +which is of course the end goal of any devoted Perl hacker. Some of us are +just beginning and find ourselves facing the perplexities of sigils. Others +are further along the path, now trying to wrap their heads around contexts. +And then, once you think you're feeling pretty okay with Perl... bam! Regular +expressions. + +Yeah, there's a lot to learn. But the journey is fun! + +In this talk, I'll present a list of various tips, tricks, modules, +techniques, whatever that have helped me level up my Perl. + +You'll get the most out of this talk if you know at least some Perl or at +least are curious about some of the crazy stuff Perl hackers come up with. diff --git a/css/common.css b/css/common.css new file mode 100644 index 0000000..5fe4e74 --- /dev/null +++ b/css/common.css @@ -0,0 +1,93 @@ +@import url(https://fonts.googleapis.com/css?family=Open+Sans); +@import url(https://fonts.googleapis.com/css?family=Muli); +@import url(https://fonts.googleapis.com/css?family=Inconsolata); + +.remark-slide-content { + font-family: 'Open Sans'; + font-size: 22px; +} + +.remark-slide-content h1, +.remark-slide-content h2, +.remark-slide-content h3 { + font-family: Muli; + font-weight: bold; +} +.remark-slide-content h2 { + font-size: 40px; +} +.remark-slide-content h3 { + font-size: 30px; +} + +.remark-slide-content li { + line-height: 2em; +} +.remark-slide-content .condensed li { + line-height: 1em; +} + +.remark-code, .remark-inline-code { + font-family: Inconsolata, monospace; +} +.remark-code { + border-radius: 5px; + border: 1px solid #ccc; +} + +.remark-slide-content blockquote { + border-radius: 5px; + border: 1px solid #ccc; + background: #f0f0f0; + margin: 1.5em 0; + padding: 1em; + quotes: "\201C""\201D""\2018""\2019"; + position: relative; +} +.remark-slide-content blockquote:before { + color: #ccc; + position: absolute; + content: open-quote; + font-size: 6em; + line-height: 0.1em; + margin-right: 0.25em; + vertical-align: -0.4em; +} + +.remark-slide-content .col { + box-sizing: border-box; + display: block; + float: left; + border: 0; + margin: 0; + padding: 0; + width: 50%; +} +.remark-slide-content .col:nth-of-type(odd) { + padding: 0 1em 0 0; +} +.remark-slide-content .col:nth-of-type(even) { + padding: 0 0 0 1em; +} +.remark-slide-content .col.sep:nth-of-type(odd) { + border-right: 1px solid #ccc; +} +.remark-slide-content .col.sep:nth-of-type(even) { + border-left: 1px solid #ccc; +} + +/* fix non-collapsing margin */ +.remark-slide-content .marginfix h3, +.remark-slide-content .marginfix ul { + margin-top: 0; +} + +.remark-slide-content .top-right { + float: right; + margin: 50px 0 0 2em; +} + +.remark-slide-content .highlight { + color: #7d9726; +} + diff --git a/css/slides.css b/css/slides.css new file mode 100644 index 0000000..2c8f3ca --- /dev/null +++ b/css/slides.css @@ -0,0 +1,107 @@ + +#slide-endurance img { + width: 400px; +} + +#slide-last .talkqr img { + display: inline-block; + width: 230px; + height: 230px; +} + +.ex-deparse .bash { + font-size: 36px; +} + +.ex-vimcheck .bash { + font-size: 32px; +} + +.ex-vim .perl { + font-size: 26px; +} + +.ex-shellpod .bash { + font-size: 22px; +} + +.ex-boilerplate .perl { + font-size: 26px; +} +.ex-boilerplate2 .perl { + font-size: 20px; +} +.ex-boilerplate .ini { + font-size: 32px; +} + +.ex-regexpdebugger .perl { + font-size: 32px; +} +.regexpdebugger-commands pre { + border-radius: 5px; + border: 1px solid #ccc; + font-size: 20px; +} + +#slide-damian img { + width: 400px; +} + +.ex-perl6 .perl { + font-size: 32px; +} + +.ex-context .perl { + font-size: 32px; +} +.ex-context2 .perl { + font-size: 28px; +} + +.ex-phases .perl { + font-size: 32px; +} + +.ex-obfuscated .perl { + font-size: 24px; +} +.ex-terse .perl { + font-size: 24px; +} + +.ex-asyncawait .perl { + font-size: 32px; +} + +.ex-owndebugger1 .bash { + font-size: 42px; +} +.ex-owndebugger2 .perl { + font-size: 32px; +} +.ex-owndebugger2 .bash { + font-size: 28px; +} + +.ex-develtrace img { + width:720px; +} +.ex-develtrace .cover-img img { + width:480px; +} +.ex-develtrace .bash { + font-size: 32px; +} + +.ex-debugger .bash { + font-size: 32px; +} + +.ex-newfeatures .perl { + font-size: 22px; +} +.ex-moo .perl { + font-size: 29px; +} + diff --git a/img/camelia.png b/img/camelia.png new file mode 100644 index 0000000..a239a74 Binary files /dev/null and b/img/camelia.png differ diff --git a/img/cover.png b/img/cover.png new file mode 100644 index 0000000..b89db83 Binary files /dev/null and b/img/cover.png differ diff --git a/img/endurance.png b/img/endurance.png new file mode 100644 index 0000000..6ca90ec Binary files /dev/null and b/img/endurance.png differ diff --git a/img/nytprof.png b/img/nytprof.png new file mode 100644 index 0000000..2c4c109 Binary files /dev/null and b/img/nytprof.png differ diff --git a/img/raptor.png b/img/raptor.png new file mode 100644 index 0000000..d4209da Binary files /dev/null and b/img/raptor.png differ diff --git a/img/regexp_debugger.png b/img/regexp_debugger.png new file mode 100644 index 0000000..66c613e Binary files /dev/null and b/img/regexp_debugger.png differ diff --git a/img/talkqr.svg b/img/talkqr.svg new file mode 100644 index 0000000..c6fec7b --- /dev/null +++ b/img/talkqr.svg @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/js/common.js b/js/common.js new file mode 100644 index 0000000..3832adb --- /dev/null +++ b/js/common.js @@ -0,0 +1,55 @@ + +/* + * Create a shortcut on a number key to jump to a named slide. + * + * Using the hotkey on the target slide will go "back" to the slide that was active before jumping + * to the target slide. + * + * Example: Jump to the slide named "myslide" when the "1" key is pressed. + * createHotkey(1, 'myslide'); + */ +function createHotkey(key, slideName) { + var targetSlide = slideshow.getSlideByName(slideName); + var lastSlide = -1; + document.addEventListener('keydown', function(e) { + if (e.which === key + 48) { + var currentNum = slideshow.getCurrentSlideIndex() + 1; + var targetNum = targetSlide.getSlideIndex() + 1; + if (currentNum !== targetNum) { + lastSlide = currentNum; + slideshow.gotoSlide(targetNum); + } + else { + slideshow.gotoSlide(lastSlide); + } + } + }); +}; + +/* + * Set a hotkey "u" to navigate backwards in time. + * + * If you get on the wrong slide, this might be the easiest way to get back on track. This is what + * you might expect the browser's "Back" button to do if it worked. + */ +(function() { + var history = []; + var skip = false; + slideshow.on('hideSlide', function(slide) { + if (skip) { + skip = false; + return; + } + history.push(slide.getSlideIndex() + 1); + }); + document.addEventListener('keydown', function(e) { + if (e.which === 85 /* [u]ndo */) { + var lastNum = history.pop(); + if (lastNum) { + skip = true; + slideshow.gotoSlide(lastNum); + } + } + }); +})(); + diff --git a/js/slides.js b/js/slides.js new file mode 100644 index 0000000..1ba4808 --- /dev/null +++ b/js/slides.js @@ -0,0 +1,7 @@ + +createHotkey(1, 'psgi-flow1'); +createHotkey(2, 'psgi-flow2'); +createHotkey(3, 'psgi-flow3'); +createHotkey(4, 'psgi-flow4'); +createHotkey(5, 'psgi-flow5'); + diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..e0f8673 --- /dev/null +++ b/notes.txt @@ -0,0 +1,42 @@ + +This talk I'm going to go over things that you don't need to know if you just +want to get by, but if you actually want to be good. + +Ground rules: +- If you have a question, get my attention and ask it. Don't save it until the + end because the format of this talk doesn't lend itself to that. + + + +I Use CPAN. +X Use B::Deparse. https://metacpan.org/pod/B::Deparse +X Document your shell scripts with pod. +X Know regular expressions. +X Use Regexp::Debugger. https://metacpan.org/pod/Regexp::Debugger +X Write vim plugins in Perl. +X Understand calling context. +X Understand execution phases. +X Understand when to be terse and when to be verbose +X Use Future::AsyncAwait. https://metacpan.org/pod/Future::AsyncAwait +- Know some XS. +- Know Unicode. + - https://youtu.be/TmTeXcEixEg 2016 - A Million Billion Squiggly Characters - rjbs + - https://stackoverflow.com/a/6163129 Best Stackoverflow answer, ever. - tchrist +X Write your own boilerplate. +X Write your own debugger. +X Don't write your own debugger because there are already some awesome ones on CPAN. +X Know the default perl debugger. +X Write modern Perl. + X Use some new features (postfix dereferencing, function signatures) + X Moo or Moose + X method signatures +X Learn Perl 6 +- Learn another language. + - Makes you write better Perl (maybe). + - Can bring some good ideas from other languages back to Perl (PSGI, async await) +- Know software design patterns. + +Cool stuff: +use aliased 'Big::Long::Package::Thing'; +my $thing = Thing->new; + diff --git a/slides.html b/slides.html new file mode 100644 index 0000000..4f97d8d --- /dev/null +++ b/slides.html @@ -0,0 +1,1737 @@ + +Level up your Perl +