piotr sarnacki for rails girls warsaw iii

22
Piotr Sarnacki

Upload: rails-girls-warsaw

Post on 18-Dec-2014

83 views

Category:

Technology


0 download

DESCRIPTION

Programming as a tool (presentation is in polish)

TRANSCRIPT

Page 1: Piotr Sarnacki for Rails Girls Warsaw III

Piotr Sarnacki

Page 2: Piotr Sarnacki for Rails Girls Warsaw III

Do czego można wykorzystać programowanie?

Page 3: Piotr Sarnacki for Rails Girls Warsaw III

Czym zajmuje się programistka?

Page 4: Piotr Sarnacki for Rails Girls Warsaw III

Programowaniem!

Page 5: Piotr Sarnacki for Rails Girls Warsaw III

Tego czego wymagają w pracy?

Page 6: Piotr Sarnacki for Rails Girls Warsaw III

A poza pracą?

Page 7: Piotr Sarnacki for Rails Girls Warsaw III

Co z nie-programistkami?

Page 8: Piotr Sarnacki for Rails Girls Warsaw III

Programowanie przydaje się w życiu?

Page 9: Piotr Sarnacki for Rails Girls Warsaw III

Programowanie to narzędzie.

Page 10: Piotr Sarnacki for Rails Girls Warsaw III

Tak samo jak czytanie i pisanie.

Page 11: Piotr Sarnacki for Rails Girls Warsaw III
Page 12: Piotr Sarnacki for Rails Girls Warsaw III

Kilka przykładów

Page 13: Piotr Sarnacki for Rails Girls Warsaw III
Page 14: Piotr Sarnacki for Rails Girls Warsaw III
Page 15: Piotr Sarnacki for Rails Girls Warsaw III
Page 16: Piotr Sarnacki for Rails Girls Warsaw III

Około 20 linii kodu

Page 17: Piotr Sarnacki for Rails Girls Warsaw III

include Geokit::Geocoders!!html = open('http://www.benandjerry.cz/site/cz/prichute/kde-nas-najdete')!doc = Nokogiri::HTML(html.read)!doc.encoding = 'utf-8'!!locations = []!!doc.css("table.kdetable").first.css("tr").each do |tr|! contents = tr.css("td").map { |td| td.text }!! city, address = contents[0], contents[2]! if city.nil? || address.nil?! next! end!! if city.chomp == "" || address.chomp == ""! next! end!! address = "#{address}, #{city}, Czech Republic".force_encoding('utf-8').encode! location = GoogleGeocoder3.geocode(address)!! locations << { latitude: location.lat, longitude: location.lng, shop: contents[1] }! sleep(1)!end!!

Page 18: Piotr Sarnacki for Rails Girls Warsaw III
Page 19: Piotr Sarnacki for Rails Girls Warsaw III

Przeliczanie proporcji składników dla różnych form do ciasta.

Page 20: Piotr Sarnacki for Rails Girls Warsaw III
Page 21: Piotr Sarnacki for Rails Girls Warsaw III

Wyłania się tutaj pewien wzorzec

Page 22: Piotr Sarnacki for Rails Girls Warsaw III

Dziękuję