SlideShare a Scribd company logo
Ruby and Rails
   by example
Ruby and Rails by example
Ruby is simple in appearance,
 but is very complex inside,
  just like our human body.
         - Yukihiro "matz" Matsumoto,
                       creator of Ruby
Example 0:
Hash / Dictionary

Recommended for you

Introducing Ruby
Introducing RubyIntroducing Ruby
Introducing Ruby

Basic introduction to the history and uses of the Ruby programming lanaguage. http://github.com/jwthompson2/barcamp-nola-2009/

barcamp2009ruby
Ruby for Java Developers
Ruby for Java DevelopersRuby for Java Developers
Ruby for Java Developers

This document provides an overview of Ruby for Java developers, covering the history and culture of both languages, their technical backgrounds, key differences in their languages and frameworks, and how Ruby on Rails works. It demonstrates Ruby concepts through examples and concludes with a discussion on performance and common use cases for each language.

javaruby on railsruby
An introduction to Ruby
An introduction to RubyAn introduction to Ruby
An introduction to Ruby

Ruby is an object-oriented scripting language that is dynamically typed and supports duck typing. It was created in the 1990s by Yukihiro "Matz" Matsumoto and has gained popularity through its use in web frameworks like Ruby on Rails. This document provides an overview of the Ruby language, including its history, basic syntax like strings and methods, core data types, control structures, classes and inheritance. It also discusses tools used by Ruby developers like RubyGems, interactive Ruby shells, and practical applications of Ruby for web development, testing, and automation through scripting. Finally, it mentions the international Ruby community and local user groups.

programmingruby
// Using C#

using System;
using System.Collections;

...

        Hashtable openWith = new Hashtable();

        openWith.Add("txt",   "notepad.exe");
        openWith.Add("bmp",   "paint.exe");
        openWith.Add("dib",   "paint.exe");
        openWith.Add("rtf",   "wordpad.exe");
# Using Ruby

openWith = { "txt"   =>   "notepad.exe",
             "bmp"   =>   "paint.exe",
             "dib"   =>   "paint.exe",
             "rtf"   =>   "wordpad.exe" }
# Using Ruby 1.9

openWith = { txt: "notepad.exe",
  bmp: "paint.exe", dib: "paint.exe",
  rtf: "wordpad.exe" }
Ruby and Rails by example

Recommended for you

Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim

This document discusses how Vim can improve productivity for Perl coding. It provides examples of using Vim motions and modes like Normal mode, Insert mode, and Visual mode to efficiently edit code. It also covers Vim features like syntax highlighting, custom syntax files, key mappings, and text objects that are useful for Perl. The document advocates that Vim is a powerful editor rather than an IDE and highlights how it can save significant time compared to less efficient editing methods.

yapcasia2009vimperl
(Parameterized) Roles
(Parameterized) Roles(Parameterized) Roles
(Parameterized) Roles

Roles are an excellent object-oriented tool both for allomorphism and for reuse. Roles facilitate allomorphism by favoring "does this object do X" versus "is this object a subclass of X". You often care more about capability than inheritance. In a sense, roles encode types better than inheritance. Roles also provide an excellent faculty for reuse. This effectively eliminates multiple inheritance, which is often the only solution for sharing code between unrelated classes. Roles can combine with conflict detection. This eliminates accidental shadowing of methods that is painful with multiple inheritance and mixins. Parameterized roles (via MooseX::Role::Parameterized) improve the reusability of roles by letting each consumer cater the role to its needs. This does sacrifice some allomorphism, but there are ways to restore it.

mooseoopperl
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby

an introduction to ruby programming language. This is a start for peoples those who start ruby on rails

ruby on railsrubyruby introduction
DO MORE
   with

LESS CODE
// Using C#

using System;
using System.Collections;

...

        Hashtable openWith = new Hashtable();

        openWith.Add("txt",   "notepad.exe");
        openWith.Add("bmp",   "paint.exe");
        openWith.Add("dib",   "paint.exe");
        openWith.Add("rtf",   "wordpad.exe");
Example 1:
Hello World
puts "Hello World!"

Recommended for you

Ruby
RubyRuby
Ruby

This document provides an overview of the Ruby programming language, including its history, philosophy, characteristics, applications, culture, syntax, built-in types, classes and methods, accessors, control flow, including code, modules, metaprogramming, web frameworks, web servers, shell scripting, testing, JRuby, and calling between Java and Ruby.

ruby
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends

The document provides an overview of Ruby on Rails and its key components. It discusses how Rails is made up of several gems including Rails, ActiveSupport, ActionPack, ActiveRecord, ActiveResource and ActionMailer. It summarizes the purpose and functionality of each gem. For example, it states that ActiveRecord connects classes to database tables for persistence, while ActionPack handles routing, controllers and views.

ruby
Javascript the New Parts v2
Javascript the New Parts v2Javascript the New Parts v2
Javascript the New Parts v2

Updated version of talk "Javascript the New Parts". I gave this at JsDay on May 12th 2011. I updated with latest stats and improved es5 coverage, most notably strict mode. Abstract: At last, ecmascript 5th edition is landing in all modern browsers. What are the new parts of the language and how can they help us to write better code? Also http://federico.galassi.net/ http://www.jsday.it/ Follow me on Twitter! https://twitter.com/federicogalassi

extensibilitygetterstrict
Example 2:
Create a Binary Tree
class Node
  attr_accessor :value

  def initialize(value = nil)
    @value = value
  end

  attr_reader :left, :right
  def left=(node); @left = create_node(node); end
  def right=(node); @right = create_node(node); end

  private
  def create_node(node)
    node.instance_of? Node ? node : Node.new(node)
  end
end
Example 2.1:
Traverse the
 Binary Tree
def traverse(node)
  visited_list = []
  inorder(node, visited)
  puts visited.join(",")
end

def inorder(node, visited)
  inorder(node.left, visited) unless node.left.nil?
  visited << node.value
  inorder(node.right, visited) unless node.right.nil?
end

Recommended for you

Rails for PHP Developers
Rails for PHP DevelopersRails for PHP Developers
Rails for PHP Developers

In this presentation we look at the similarities and differences that a PHP developer will want to keep in mind when adding Rails to their toolbox.

railsphpruby on rails
Let's Learn Ruby - Basic
Let's Learn Ruby - BasicLet's Learn Ruby - Basic
Let's Learn Ruby - Basic

This document provides an overview of the Ruby programming language. It introduces basic Ruby concepts like variables, data types, flow control, classes and objects. It also discusses tools and frameworks like Rails, gems, and testing. The document encourages learning Ruby and provides resources to get started, including trying an interactive tutorial and installing a development environment. It emphasizes that Ruby is fun and easy to learn.

ruby
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl

Perl provides many powerful features and modules that allow developers to customize and extend the language. Some popular modules include Moose for object-oriented programming, TryCatch for exception handling inspired by Perl 6, and P5.10 features that backport Perl 6 functionality. While useful, some features like autoboxing and state variables could introduce subtle bugs if misused. Overall, Perl's extensibility makes it a very flexible language that can be adapted to many different use cases.

2009taiwanosdc
def traverse(node)
  visited_list = []
  inorder node, visited
  puts visited.join ","
end

def inorder(node, visited)
  inorder node.left, visited unless node.left.nil?
  visited << node.value
  inorder node.right, visited unless node.right.nil?
end
Example 3:
Create a Person →
   Student →
College Student
 class hierarchy
class Person
  attr_accessor :name
end

class Student < Person
  attr_accessor :school
end

class CollegeStudent < Student
  attr_accessor :course
end

x = CollegeStudent.new
x.name = "John Doe"
x.school = "ABC University"
x.course = "Computer Science"
Example 4:
Call a method in a
    "primitive"

Recommended for you

P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)

Part of a series of talk to help you write your first Perl 6 program today. So its basic syntax and concepts of its object orientation and a comparison to the widely used P5 OO system Moose which is similar by no accident.

oopperl 6
Bologna Developer Zone - About Kotlin
Bologna Developer Zone - About KotlinBologna Developer Zone - About Kotlin
Bologna Developer Zone - About Kotlin

The slides presented during the BDZ Meetup about Kotlin held in Bologna on October 21th, 2017 by Marco Vasapollo (ceo@metaring.com)

kotlinjavac#
JS Level Up: Prototypes
JS Level Up: PrototypesJS Level Up: Prototypes
JS Level Up: Prototypes

Take a dive into JavaScript prototypes from the perspective of constructor functions. Originally given at Charlotte JS on June 18, 2015.

javascriptjsprototypes
nil.methods

true.object_id

1.upto(10) do |x|
  puts x
end
Example 5:
 Find the sum of the
squares of all numbers
under 10,000 divisible
    by 3 and/or 5
x = 1
sum = 0
while x < 10000 do
  if x % 3 == 0 or x % 5 == 0
    sum += x * x
  end
end
puts sum
puts (1..10000).
  select { |x| x % 3 == 0 or x % 5 == 0}.
  map {|x| x * x }.
  reduce(:+)

Recommended for you

Introducing ruby on rails
Introducing ruby on railsIntroducing ruby on rails
Introducing ruby on rails

This document provides an introduction to Ruby on Rails, including: - An overview of the Model-View-Controller framework and REST architecture that Rails is built on - Examples of basic Rails concepts like ActiveRecord and routing - A "Hello World" example using the Ruby language - Explanations of key Ruby concepts like blocks and duck typing

ruby on railsprogramming language
A Blink Into The Rails Magic
A Blink Into The Rails MagicA Blink Into The Rails Magic
A Blink Into The Rails Magic

This document discusses the meta-programming and code generation capabilities of the Ruby on Rails framework. It describes how Rails uses conventions to generate common code structures like models, controllers and views. It also explains how Rails dynamically generates methods at runtime based on attributes in database tables to provide an intuitive ORM layer. The document states that this level of convention and automation allows developers to be highly productive by focusing on domain logic rather than boilerplate code.

athens digital weekrailsprogramming
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)

The document provides examples of how to perform common programming tasks in Ruby and Ruby on Rails compared to other languages like C#. It shows how Ruby and Rails allow doing more with less code through features like hashes, object oriented programming, metaprogramming, and the MVC framework. The examples include creating hashes, binary trees, class hierarchies, adding methods to numbers, and defining behavior for different instances. It also provides a Rails example for a Twitter clone app and lists resources for learning Ruby and Rails.

Example 6:
  Find all employees
older than 30 and sort
     by last name
oldies = employees.select { |e| e.age > 30 }.
  sort { |e1, e2| e1.last_name <=> e2.last_name }
Example 7:
Assign a method to a
      variable
hello = Proc.new { |string| puts "Hello #{string}" }

hello.call "Alice"

Recommended for you

Uses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & StubsUses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & Stubs

This document provides an overview of mocks and stubs in testing, using Ruby and RSpec examples. It establishes common terminology around mock objects, shows appropriate uses of mocks such as defining interfaces and simulating situations, and demonstrates abuses such as modifying the subject under test and creating "mock trainwrecks" that tie specs too tightly to implementation details. The goal is to understand best practices for using mocks to write clear, maintainable tests.

Extreme Swift
Extreme SwiftExtreme Swift
Extreme Swift

Apple's Swift has achieved the top place in Stack Overflow's "Most Loved" list of programming languages in its 2015 Developer Survey. Based on information gleaned from GitHub and Stack Overflow, analyst firm RedMonk has seen Swift's popularity ranking soar from 68 to 22 in an unprecedented 6 months. The "Extreme Swift" event does not require advanced, or even any, knowledge of Swift. Learn about some of the more outrageous features of the language which help explain what the fuss is all about! Never look at programming the same way again — even if you never end up writing a single line of Swift code in your life.

appleiosipad
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails

Ruby is a dynamic, open source programming language that is interpreted, object-oriented, and functional. It focuses on simplicity and emphasizes programmer productivity. Ruby on Rails is a web application framework built on Ruby that follows the model-view-controller architectural pattern. It aims to make web development faster and easier through its conventions, including generating scaffolding for basic CRUD operations on models.

Example 8:
Add a "plus" method to
     all numbers
class Numeric
  def plus(value)
    self.+(value)
  end
end
Example 9:
  Define different
behavior for different
     instances
alice = Person.new
bob = Person.new

alice.instance_eval do
  def hello
    puts "Hello"
  end
end

def bob.hello
  puts "Howdy!"
end

Recommended for you

JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript Workshop

Put on by USC's Upsilon Pi Epsilon as part of Wonderful World of Web2.0 Workshop Series. http://pollux.usc.edu/~upe/

Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails

- Ruby is an interactive, object-oriented programming language created by Yukihiro Matsumoto in 1995. - Ruby on Rails is a web application framework built on Ruby that emphasizes convention over configuration and is optimized for programmer happiness. - The document discusses Ruby and Ruby on Rails, providing an overview of their history, key principles like MVC, REST, and conventions used in Rails. It also provides examples of modeling data with classes and ActiveRecord in Rails.

ruby on railsruby
lab4_php
lab4_phplab4_php
lab4_php

This document provides instructions for Lab 4 of an information systems design course. The lab aims to build experience with fundamental PHP functions related to arrays, strings, and regular expressions. Students will modify PHP code snippets to work with multi-dimensional arrays, define and call functions, and perform string operations like searching and replacing text. The lab consists of 4 steps involving PHP code to demonstrate various PHP features and concepts.

php4
Example 10:
Make Duck and
 Person swim
module Swimmer
  def swim
    puts "This #{self.class} is swimming"
  end
end

class Duck
  include Swimmer
end

class Person
  include Swimmer
end

Duck.new.swim
Student.new.swim
Ruby and Rails by example
Ruby and Rails by example

Recommended for you

lab4_php
lab4_phplab4_php
lab4_php

This document provides instructions for Lab 4 of an information systems design course. The lab aims to build experience with fundamental PHP functions related to arrays, strings, and regular expressions. Students will modify PHP code snippets to work with multi-dimensional arrays, define and call functions, and perform string operations like searching and replacing text. The lab consists of 4 steps involving PHP code to demonstrate various language features like joining strings, defining functions, and using regular expressions.

php4
The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88

The document discusses using the Ring programming language to develop web applications through CGI (Common Gateway Interface). It covers configuring the Apache web server to support Ring CGI files, writing a basic "Hello World" CGI program in Ring, and using the Ring Web Library to simplify CGI development. Examples are provided that demonstrate generating HTML forms and handling HTTP GET requests to retrieve submitted form data. The Web Library features templates, file uploads, and MVC patterns to help structure full-featured web applications in Ring.

ring programming languageringring programming
Snakes for Camels
Snakes for CamelsSnakes for Camels
Snakes for Camels

Python and Perl are both popular scripting languages that are interpreted, general purpose, and support multiple programming paradigms. While they have similar capabilities, Python emphasizes readability and has a stronger community around its development. Python also has a large standard library and is used in many popular projects. However, Python is still working through issues related to the transition from Python 2 to Python 3.

pythonyapc2015perl
Example 0:
Make a Twitter Clone
$   rails new twitclone
$   cd twitclone
$   rails generate scaffold tweet message:string
$   rake db:migrate
$   rails server
$   rails new twitclone
$   cd twitclone
$   rails generate scaffold tweet message:string
$   rake db:migrate
$   rails server
Ruby on Rails
ISN'T MAGIC

Recommended for you

Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.

Overview of Trampoline Objects in Perl with examples for lazy construction, lazy module use, added sanity checks. This version includes corrections from the original presented at OSCON 2013 and comments.

object-oriented programmingoopperl
Object Oriented Programming Using C++: C++ Namespaces.pptx
Object Oriented Programming Using C++: C++ Namespaces.pptxObject Oriented Programming Using C++: C++ Namespaces.pptx
Object Oriented Programming Using C++: C++ Namespaces.pptx

Object Oriented Programming Using C++: C++ Namespaces

object oriented programming
Tres Gemas De Ruby
Tres Gemas De RubyTres Gemas De Ruby
Tres Gemas De Ruby

The document discusses Ruby testing tools including Rake for building tasks, RSpec for behavior-driven development testing, and Webrat for web application testing. It provides examples of using Rake to define tasks for compiling Flex applications, examples of RSpec tests for methods like factorial and prime?, and an example Webrat test for creating a CEO letter campaign. Links are also included for the Rake, RSpec and Webrat documentation.

dynlangchileruby
Ruby and Rails by example
Ruby Features
Dynamic
 Object Oriented
   Functional
Metaprogramming
+

Recommended for you

Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7

This document provides an introduction to the Ruby programming language. It discusses Ruby's object-oriented nature, dynamic typing, syntax similarities to other languages like Java and C#, and the ease of learning Ruby. It also demonstrates simple Ruby code examples for arrays, hashes, classes, inheritance and modules. Testing practices like TDD (test-driven development) are emphasized. Popular Ruby web frameworks like Ruby on Rails, Sinatra and libraries like HAML and SASS are also introduced.

ruby tccc7
DevNation'15 - Using Lambda Expressions to Query a Datastore
DevNation'15 - Using Lambda Expressions to Query a DatastoreDevNation'15 - Using Lambda Expressions to Query a Datastore
DevNation'15 - Using Lambda Expressions to Query a Datastore

A presentation given at DevNation 2015 (Boston) of a prototype library that leverages Java Lambda Expressions to manage data on MongoDB.

java lambda mongodb
Postobjektové programovanie v Ruby
Postobjektové programovanie v RubyPostobjektové programovanie v Ruby
Postobjektové programovanie v Ruby

The document discusses object-oriented programming in Ruby. It introduces some key concepts in OOP like classes, objects, identity, state, and behavior. It also covers Ruby-specific paradigms like modules and mixins. Some common design patterns are mentioned like singleton, iterator, and decorator. The document provides examples to illustrate concepts like inheritance, polymorphism, and visibility in modules.

rubyslavapostoop
Software
  Engineering
"Best Practices"
MVC   CoC
  DRY
TDD   REST
= Productivity
= Magic?

Recommended for you

Angular Schematics
Angular SchematicsAngular Schematics
Angular Schematics

Schematics allow developers to define rules that transform a file system tree representation. They provide a workflow tool for scaffolding new components and services as well as updating existing code. The Angular CLI uses schematics under the hood to provide its functionality. Developers can build their own schematics to customize workflows by defining rules that apply transformations to a tree representation of files.

javascriptangular2angular
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails

Ruby is a dynamic, open source programming language that can be used to build web applications. It uses the MVC pattern for organizing applications into models, views, and controllers. The Rails framework is built on Ruby and provides conventions for building database-backed web applications rapidly. Ruby code can also be used to encrypt PE files by adding a decryption stub section and adjusting the entry point address in the PE header. While Ruby code is easy to read and maintain, performance can sometimes be slower compared to other languages.

CppTutorial.ppt
CppTutorial.pptCppTutorial.ppt
CppTutorial.ppt

The document provides an overview of several C++ concepts including basic syntax, compiling programs, argument passing, dynamic memory allocation, and object-oriented programming. It demonstrates simple C++ programs and functions. It discusses best practices like separating interface and implementation using header files. It also introduces C++ standard library features like vectors and the importance of avoiding unnecessary copying.

ghjhj
DO MORE
   with

LESS CODE
Rails Example:
Demo a Twitter Clone
https://github.com/bryanbibat/microblog31

       Authentication – Devise
       Attachments – Paperclip
        Pagination – Kaminari
       Template Engine – Haml
        UI – Twitter Bootstrap
Bonus Example:
  Scale the
 Twitter Clone

Recommended for you

Ruby gems
Ruby gemsRuby gems
Ruby gems

The document provides information about using Ruby gems. It discusses installing rubygems with "sudo apt-get install rubygems", then installing specific gems like git with "gem install git". It provides an example of using the git gem to log commits between two versions. It also briefly mentions HAML, SASS, HPricot, RSpec, Cucumber, and OmniAuth gems.

ruby gems gem
Hd 10 japan
Hd 10 japanHd 10 japan
Hd 10 japan

from https://platinumkaraoke.ph/music-update-category/major-hd10/

Static Sites in Ruby
Static Sites in RubyStatic Sites in Ruby
Static Sites in Ruby

This document discusses options for building static sites in Ruby. It outlines pros of using Jekyll, such as being well-known and having many plugins, but notes some missing features like asset precompilation and LiveReload. Alternatives to Jekyll are presented, including Middleman and using Sinatra for semi-static sites. The document concludes by thanking the audience.

rubyblogsjekyll
Thank You For
  Listening!
Philippine Ruby Users Group:
      http://pinoyrb.org
me: http://bryanbibat.net | @bry_bibat

More Related Content

What's hot

Real life-coffeescript
Real life-coffeescriptReal life-coffeescript
Real life-coffeescript
David Furber
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
Aizat Faiz
 
5 Tips for Better JavaScript
5 Tips for Better JavaScript5 Tips for Better JavaScript
5 Tips for Better JavaScript
Todd Anglin
 
Introducing Ruby
Introducing RubyIntroducing Ruby
Introducing Ruby
James Thompson
 
Ruby for Java Developers
Ruby for Java DevelopersRuby for Java Developers
Ruby for Java Developers
Robert Reiz
 
An introduction to Ruby
An introduction to RubyAn introduction to Ruby
An introduction to Ruby
Wes Oldenbeuving
 
Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim
Lin Yo-An
 
(Parameterized) Roles
(Parameterized) Roles(Parameterized) Roles
(Parameterized) Roles
sartak
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
Ranjith Siji
 
Ruby
RubyRuby
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
旻琦 潘
 
Javascript the New Parts v2
Javascript the New Parts v2Javascript the New Parts v2
Javascript the New Parts v2
Federico Galassi
 
Rails for PHP Developers
Rails for PHP DevelopersRails for PHP Developers
Rails for PHP Developers
Robert Dempsey
 
Let's Learn Ruby - Basic
Let's Learn Ruby - BasicLet's Learn Ruby - Basic
Let's Learn Ruby - Basic
Eddie Kao
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
Kang-min Liu
 
P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)
lichtkind
 
Bologna Developer Zone - About Kotlin
Bologna Developer Zone - About KotlinBologna Developer Zone - About Kotlin
Bologna Developer Zone - About Kotlin
Marco Vasapollo
 
JS Level Up: Prototypes
JS Level Up: PrototypesJS Level Up: Prototypes
JS Level Up: Prototypes
Vernon Kesner
 
Introducing ruby on rails
Introducing ruby on railsIntroducing ruby on rails
Introducing ruby on rails
Priceen
 
A Blink Into The Rails Magic
A Blink Into The Rails MagicA Blink Into The Rails Magic
A Blink Into The Rails Magic
Nikos Dimitrakopoulos
 

What's hot (20)

Real life-coffeescript
Real life-coffeescriptReal life-coffeescript
Real life-coffeescript
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 
5 Tips for Better JavaScript
5 Tips for Better JavaScript5 Tips for Better JavaScript
5 Tips for Better JavaScript
 
Introducing Ruby
Introducing RubyIntroducing Ruby
Introducing Ruby
 
Ruby for Java Developers
Ruby for Java DevelopersRuby for Java Developers
Ruby for Java Developers
 
An introduction to Ruby
An introduction to RubyAn introduction to Ruby
An introduction to Ruby
 
Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim
 
(Parameterized) Roles
(Parameterized) Roles(Parameterized) Roles
(Parameterized) Roles
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
 
Ruby
RubyRuby
Ruby
 
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
 
Javascript the New Parts v2
Javascript the New Parts v2Javascript the New Parts v2
Javascript the New Parts v2
 
Rails for PHP Developers
Rails for PHP DevelopersRails for PHP Developers
Rails for PHP Developers
 
Let's Learn Ruby - Basic
Let's Learn Ruby - BasicLet's Learn Ruby - Basic
Let's Learn Ruby - Basic
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
 
P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)
 
Bologna Developer Zone - About Kotlin
Bologna Developer Zone - About KotlinBologna Developer Zone - About Kotlin
Bologna Developer Zone - About Kotlin
 
JS Level Up: Prototypes
JS Level Up: PrototypesJS Level Up: Prototypes
JS Level Up: Prototypes
 
Introducing ruby on rails
Introducing ruby on railsIntroducing ruby on rails
Introducing ruby on rails
 
A Blink Into The Rails Magic
A Blink Into The Rails MagicA Blink Into The Rails Magic
A Blink Into The Rails Magic
 

Similar to Ruby and Rails by example

Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
bryanbibat
 
Uses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & StubsUses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & Stubs
PatchSpace Ltd
 
Extreme Swift
Extreme SwiftExtreme Swift
Extreme Swift
Movel
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
bryanbibat
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript Workshop
Pamela Fox
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
rstankov
 
lab4_php
lab4_phplab4_php
lab4_php
tutorialsruby
 
lab4_php
lab4_phplab4_php
lab4_php
tutorialsruby
 
The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88
Mahmoud Samir Fayed
 
Snakes for Camels
Snakes for CamelsSnakes for Camels
Snakes for Camels
miquelruizm
 
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
Workhorse Computing
 
Object Oriented Programming Using C++: C++ Namespaces.pptx
Object Oriented Programming Using C++: C++ Namespaces.pptxObject Oriented Programming Using C++: C++ Namespaces.pptx
Object Oriented Programming Using C++: C++ Namespaces.pptx
RashidFaridChishti
 
Tres Gemas De Ruby
Tres Gemas De RubyTres Gemas De Ruby
Tres Gemas De Ruby
Leonardo Soto
 
Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7
Brian Hogan
 
DevNation'15 - Using Lambda Expressions to Query a Datastore
DevNation'15 - Using Lambda Expressions to Query a DatastoreDevNation'15 - Using Lambda Expressions to Query a Datastore
DevNation'15 - Using Lambda Expressions to Query a Datastore
Xavier Coulon
 
Postobjektové programovanie v Ruby
Postobjektové programovanie v RubyPostobjektové programovanie v Ruby
Postobjektové programovanie v Ruby
Jano Suchal
 
Angular Schematics
Angular SchematicsAngular Schematics
Angular Schematics
Christoffer Noring
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
Hesham Shabana
 
CppTutorial.ppt
CppTutorial.pptCppTutorial.ppt
CppTutorial.ppt
HODZoology3
 
Ruby gems
Ruby gemsRuby gems
Ruby gems
Papp Laszlo
 

Similar to Ruby and Rails by example (20)

Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
 
Uses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & StubsUses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & Stubs
 
Extreme Swift
Extreme SwiftExtreme Swift
Extreme Swift
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript Workshop
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
 
lab4_php
lab4_phplab4_php
lab4_php
 
lab4_php
lab4_phplab4_php
lab4_php
 
The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88
 
Snakes for Camels
Snakes for CamelsSnakes for Camels
Snakes for Camels
 
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
 
Object Oriented Programming Using C++: C++ Namespaces.pptx
Object Oriented Programming Using C++: C++ Namespaces.pptxObject Oriented Programming Using C++: C++ Namespaces.pptx
Object Oriented Programming Using C++: C++ Namespaces.pptx
 
Tres Gemas De Ruby
Tres Gemas De RubyTres Gemas De Ruby
Tres Gemas De Ruby
 
Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7
 
DevNation'15 - Using Lambda Expressions to Query a Datastore
DevNation'15 - Using Lambda Expressions to Query a DatastoreDevNation'15 - Using Lambda Expressions to Query a Datastore
DevNation'15 - Using Lambda Expressions to Query a Datastore
 
Postobjektové programovanie v Ruby
Postobjektové programovanie v RubyPostobjektové programovanie v Ruby
Postobjektové programovanie v Ruby
 
Angular Schematics
Angular SchematicsAngular Schematics
Angular Schematics
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
CppTutorial.ppt
CppTutorial.pptCppTutorial.ppt
CppTutorial.ppt
 
Ruby gems
Ruby gemsRuby gems
Ruby gems
 

More from bryanbibat

Hd 10 japan
Hd 10 japanHd 10 japan
Hd 10 japan
bryanbibat
 
Static Sites in Ruby
Static Sites in RubyStatic Sites in Ruby
Static Sites in Ruby
bryanbibat
 
So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...
bryanbibat
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
bryanbibat
 
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
bryanbibat
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
bryanbibat
 
Rails is Easy*
Rails is Easy*Rails is Easy*
Rails is Easy*
bryanbibat
 
Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)
bryanbibat
 
Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)
bryanbibat
 
From Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to LearningFrom Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to Learning
bryanbibat
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
bryanbibat
 
Preparing for the WebGeek DevCup
Preparing for the WebGeek DevCupPreparing for the WebGeek DevCup
Preparing for the WebGeek DevCup
bryanbibat
 
Productive text editing with Vim
Productive text editing with VimProductive text editing with Vim
Productive text editing with Vim
bryanbibat
 
Latest Trends in Web Technologies
Latest Trends in Web TechnologiesLatest Trends in Web Technologies
Latest Trends in Web Technologies
bryanbibat
 
Virtualization
VirtualizationVirtualization
Virtualization
bryanbibat
 
Some Myths in Software Development
Some Myths in Software DevelopmentSome Myths in Software Development
Some Myths in Software Development
bryanbibat
 
Latest Trends in Open Source Web Technologies
Latest Trends in Open Source Web TechnologiesLatest Trends in Open Source Web Technologies
Latest Trends in Open Source Web Technologies
bryanbibat
 
What it takes to be a Web Developer
What it takes to be a Web DeveloperWhat it takes to be a Web Developer
What it takes to be a Web Developer
bryanbibat
 
before you leap
before you leapbefore you leap
before you leap
bryanbibat
 
Sowing the Seeds
Sowing the SeedsSowing the Seeds
Sowing the Seeds
bryanbibat
 

More from bryanbibat (20)

Hd 10 japan
Hd 10 japanHd 10 japan
Hd 10 japan
 
Static Sites in Ruby
Static Sites in RubyStatic Sites in Ruby
Static Sites in Ruby
 
So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
 
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
 
Rails is Easy*
Rails is Easy*Rails is Easy*
Rails is Easy*
 
Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)
 
Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)
 
From Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to LearningFrom Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to Learning
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
Preparing for the WebGeek DevCup
Preparing for the WebGeek DevCupPreparing for the WebGeek DevCup
Preparing for the WebGeek DevCup
 
Productive text editing with Vim
Productive text editing with VimProductive text editing with Vim
Productive text editing with Vim
 
Latest Trends in Web Technologies
Latest Trends in Web TechnologiesLatest Trends in Web Technologies
Latest Trends in Web Technologies
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Some Myths in Software Development
Some Myths in Software DevelopmentSome Myths in Software Development
Some Myths in Software Development
 
Latest Trends in Open Source Web Technologies
Latest Trends in Open Source Web TechnologiesLatest Trends in Open Source Web Technologies
Latest Trends in Open Source Web Technologies
 
What it takes to be a Web Developer
What it takes to be a Web DeveloperWhat it takes to be a Web Developer
What it takes to be a Web Developer
 
before you leap
before you leapbefore you leap
before you leap
 
Sowing the Seeds
Sowing the SeedsSowing the Seeds
Sowing the Seeds
 

Recently uploaded

DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 

Recently uploaded (20)

DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 

Ruby and Rails by example

  • 1. Ruby and Rails by example
  • 3. Ruby is simple in appearance, but is very complex inside, just like our human body. - Yukihiro "matz" Matsumoto, creator of Ruby
  • 4. Example 0: Hash / Dictionary
  • 5. // Using C# using System; using System.Collections; ... Hashtable openWith = new Hashtable(); openWith.Add("txt", "notepad.exe"); openWith.Add("bmp", "paint.exe"); openWith.Add("dib", "paint.exe"); openWith.Add("rtf", "wordpad.exe");
  • 6. # Using Ruby openWith = { "txt" => "notepad.exe", "bmp" => "paint.exe", "dib" => "paint.exe", "rtf" => "wordpad.exe" }
  • 7. # Using Ruby 1.9 openWith = { txt: "notepad.exe", bmp: "paint.exe", dib: "paint.exe", rtf: "wordpad.exe" }
  • 9. DO MORE with LESS CODE
  • 10. // Using C# using System; using System.Collections; ... Hashtable openWith = new Hashtable(); openWith.Add("txt", "notepad.exe"); openWith.Add("bmp", "paint.exe"); openWith.Add("dib", "paint.exe"); openWith.Add("rtf", "wordpad.exe");
  • 13. Example 2: Create a Binary Tree
  • 14. class Node attr_accessor :value def initialize(value = nil) @value = value end attr_reader :left, :right def left=(node); @left = create_node(node); end def right=(node); @right = create_node(node); end private def create_node(node) node.instance_of? Node ? node : Node.new(node) end end
  • 16. def traverse(node) visited_list = [] inorder(node, visited) puts visited.join(",") end def inorder(node, visited) inorder(node.left, visited) unless node.left.nil? visited << node.value inorder(node.right, visited) unless node.right.nil? end
  • 17. def traverse(node) visited_list = [] inorder node, visited puts visited.join "," end def inorder(node, visited) inorder node.left, visited unless node.left.nil? visited << node.value inorder node.right, visited unless node.right.nil? end
  • 18. Example 3: Create a Person → Student → College Student class hierarchy
  • 19. class Person attr_accessor :name end class Student < Person attr_accessor :school end class CollegeStudent < Student attr_accessor :course end x = CollegeStudent.new x.name = "John Doe" x.school = "ABC University" x.course = "Computer Science"
  • 20. Example 4: Call a method in a "primitive"
  • 22. Example 5: Find the sum of the squares of all numbers under 10,000 divisible by 3 and/or 5
  • 23. x = 1 sum = 0 while x < 10000 do if x % 3 == 0 or x % 5 == 0 sum += x * x end end puts sum
  • 24. puts (1..10000). select { |x| x % 3 == 0 or x % 5 == 0}. map {|x| x * x }. reduce(:+)
  • 25. Example 6: Find all employees older than 30 and sort by last name
  • 26. oldies = employees.select { |e| e.age > 30 }. sort { |e1, e2| e1.last_name <=> e2.last_name }
  • 27. Example 7: Assign a method to a variable
  • 28. hello = Proc.new { |string| puts "Hello #{string}" } hello.call "Alice"
  • 29. Example 8: Add a "plus" method to all numbers
  • 30. class Numeric def plus(value) self.+(value) end end
  • 31. Example 9: Define different behavior for different instances
  • 32. alice = Person.new bob = Person.new alice.instance_eval do def hello puts "Hello" end end def bob.hello puts "Howdy!" end
  • 33. Example 10: Make Duck and Person swim
  • 34. module Swimmer def swim puts "This #{self.class} is swimming" end end class Duck include Swimmer end class Person include Swimmer end Duck.new.swim Student.new.swim
  • 37. Example 0: Make a Twitter Clone
  • 38. $ rails new twitclone $ cd twitclone $ rails generate scaffold tweet message:string $ rake db:migrate $ rails server
  • 39. $ rails new twitclone $ cd twitclone $ rails generate scaffold tweet message:string $ rake db:migrate $ rails server
  • 43. Dynamic Object Oriented Functional Metaprogramming
  • 44. +
  • 46. MVC CoC DRY TDD REST
  • 49. DO MORE with LESS CODE
  • 50. Rails Example: Demo a Twitter Clone
  • 51. https://github.com/bryanbibat/microblog31 Authentication – Devise Attachments – Paperclip Pagination – Kaminari Template Engine – Haml UI – Twitter Bootstrap
  • 52. Bonus Example: Scale the Twitter Clone
  • 53. Thank You For Listening! Philippine Ruby Users Group: http://pinoyrb.org me: http://bryanbibat.net | @bry_bibat