Permalink
Browse files

2011-09-19 Workshop af83 (lightning talks)

  • Loading branch information...
1 parent 17bcb63 commit 74331a8ada7b36324f451b38791df5b482e0a443 @nono committed Sep 16, 2011
@@ -0,0 +1,5 @@
+{
+ "title": "Pry, an IRB alternative",
+ "theme": "shower",
+ "sections": ["slides"]
+}
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,97 @@
+!SLIDE
+# PRY #
+![Logo de pry](pry.png)
+
+http://pry.github.com/
+
+!SLIDE
+# Une alternative à IRB, mais en mieux : #
+
+* Autocomplétion
+* Historique
+* Coloration syntaxique
+* Navigation dans le code source
+* Introspection simplifiée
+* Helpers, aide, configuration, plugins, etc.
+
+!SLIDE
+# Quickstart #
+
+ gem install pry
+ pry
+ pry(main)> "foo".up<TAB>
+ .upcase .upcase! .upto
+ pry(main)> "foo".upcase
+ => "FOO"
+
+!SLIDE
+# Lister les méthodes #
+
+ pry(main)> require 'slide-em-up'
+ => true
+ pry(main)> cd SlideEmUp::Presentation
+ pry(SlideEmUp::Presentation):1> ls -M
+ [:common, :common=, :html, :meta, :meta=, :path_for_asset, :theme, :theme=, :titles, :titles=]
+
+!SLIDE
+# Afficher une méthode #
+
+ pry:1> show-method html
+ From: /home/nono/.rvm/gems/ruby-1.9.2-p180/gems/slide-em-up-0.1.8/lib/slide-em-up/presentation.rb @ line 26:
+ Number of lines: 4
+
+```ruby
+def html
+ str = File.read("#{theme.dir}/index.erb")
+ Erubis::Eruby.new(str).result(:meta => meta, :theme => theme, :sections => sections)
+end
+```
+
+!SLIDE
+# Afficher la doc (rdoc, yard, etc.) #
+
+ pry(main)> show-doc Pry#r
+
+ signature: r(target=?, eval_string=?)
+
+ Perform a read [...]
+ param [Object, Binding] target The receiver of the read.
+ param [String] eval_string Optionally Prime eval_string with a start value.
+ return [String] The Ruby expression.
+ example
+ Pry.new.r(Object.new)
+
+!SLIDE
+# Shell mode #
+
+ pry(main)> .ls -l
+ -rw-r--r-- 1 nono nono 79 2011-09-13 22:46 presentation.json
+ drwxr-xr-x 2 nono nono 4096 2011-08-29 01:41 slides
+ pry(main)> pres = "presentation.json"
+ pry(main)> .cat #{pres}
+ {
+ "title": "Pry, an IRB alternative",
+ "theme": "shower",
+ "sections": ["slides"]
+ }
+
+!SLIDE
+# L'aide #
+
+ pry(main)> help
+ Command List:
+ --
+ help This menu.
+ install-command Install a disabled command.
+ toggle-color Toggle syntax highlighting.
+ [...]
+
+!SLIDE
+# Intégration avec Rails #
+
+`rails console` + `pry` = `<3`
+
+https://github.com/pry/pry/wiki/Setting-up-Rails-to-use-Pry
+
+!SLIDE shout
+# Conclusion #
@@ -0,0 +1,5 @@
+{
+ "title": "Sugar.js: Javascript, sweetened",
+ "theme": "shower",
+ "sections": ["slides"]
+}
@@ -0,0 +1,97 @@
+!SLIDE shout
+# Sugar.js&nbsp; Javascript, sweetened #
+
+!SLIDE
+# Quoi qu'est-ce ? #
+
+http://sugarjs.com/
+
+* Une bibliothèque JS
+* Ni jQuery, ni Backbone, plutôt un équivalent d'underscore
+* Mais avec les extensions déjà incluses
+
+!SLIDE
+# Functions #
+
+```javascript
+(function(a) {
+ // this = 'wasabi', a = 'bobby'
+}).bind('wasabi', 'bobby')();
+
+(function() {
+ // delayed 500ms
+}).delay(500);
+```
+
+!SLIDE
+# Objects #
+
+```javascript
+Object.keys({ broken: 'wear' });
+ // => ["broken"]
+Object.values({ broken: 'wear' });
+ // => ["wear"]
+Object.isString('yes, it is');
+ // => true
+```
+
+!SLIDE
+# Arrays #
+
+```javascript
+['rocksteady','and','bebop'].sortBy('length');
+ // => ["and","bebop","rocksteady"]
+['rocksteady','and','bebop'].map(function(n) {
+ return n.length;
+}); // => [10,3,5]
+['rocksteady','and','bebop'].from(1);
+ // => ["and","bebop"]
+```
+
+!SLIDE
+# Strings #
+
+```javascript
+'welcome'.pad(' ', 1).pad('-', 3);
+ // => "--- welcome ---"
+'caps_lock'.camelize();
+ // => "CapsLock"
+'<p>some text</p>'.escapeHTML();
+ // => "&lt;p&gt;some text&lt;/p&gt;"
+```
+
+!SLIDE
+# Numbers #
+
+```javascript
+(4388.43).format(' ', ',');
+ // => "4 388,43"
+
+(2).upto(6, function(n) {
+ // This function is called 5 times
+ // receiving n as the value.
+});
+```
+
+!SLIDE
+# RegExp #
+
+```javascript
+RegExp.escape("oh not /b/, aren't we?");
+ // => "oh not \\/b\\/, aren\\'t we\\?"
+```
+
+!SLIDE
+# Dates #
+
+```javascript
+Date.create(1234567899999);
+ // => "Saturday, February 14, 2009 00:31"
+Date.create().beginningOfDay();
+ // => "Monday, September 19, 2011 00:00"
+Date.create().format('{yyyy}-{MM}-{dd}T{hh}:{mm}:{ss}');
+ // => "2011-09-16T15:32:00"
+```
+
+!SLIDE shout
+# Sugar.js, c'est bon, mangez-en ! #
View
@@ -21,6 +21,7 @@ or with [slide'em up](https://github.com/nono/slide-em-up).
* 2011-07-11 - [Libre Software Meeting](http://2011.rmll.info/) - [LinuxFr.org, un joli site Ruby on Rails](https://linuxfr.org/images/historique/rmll2011/20110711_LinuxFr_un_joli_site_Rails/) (slides in french)
* 2011-07-12 - [Libre Software Meeting](http://2011.rmll.info/) - [How to use well LinuxFr.org?](https://linuxfr.org/images/historique/rmll2011/https://linuxfr.org/images/historique/rmll2011/rmll2011_linuxfr_org.pdf)
* 2011-08-29 - [Workshop af83](http://dev.af83.com) - Law of Demeter (french)
+* 2011-09-19 - [Workshop af83](http://dev.af83.com) - Pry and Sugar.js (french)
Contact

0 comments on commit 74331a8

Please sign in to comment.