background preloader

Ruby Tuts:

Facebook Twitter

Modern Javascript: Develop and Design - Larry Ullman's Book Forums. Newest 'javascript' Questions. Austin.rb. 502 Bad Gateway. Ruby QuickRef. Table of Contents Language General Tips These are tips I’ve given over and over and over and over… Use 2 space indent, no tabs.

Ruby QuickRef

Use [] over Array.new. See for more. General Syntax Rules Comments start with a pound/sharp (#) character and go to EOL. Reserved Words alias and BEGIN begin break case class def defined? Types Basic types are numbers, strings, ranges, regexen, symbols, arrays, and hashes. Numbers 1231_234123.451.2e-30xffff 0b01011 0377 ? Strings In all of the %() cases below, you may use any matching characters or any single character for delimiters. %[], %!! 'no interpolation'"#{interpolation}, and backslashes\n"%q(no interpolation)%Q(interpolation and backslashes)%(interpolation and backslashes)`echo command interpretation with interpolation and backslashes`%x(echo command interpretation with interpolation and backslashes) Delightful lessons for dedicated programmers. Ruby/2013-01-22-book-problems.md at master · Duke-PL-Course/Ruby.

Ruby Quiz - MUD Client (#45) MUD Client (#45) Sy has been searching for a Ruby scriptable MUD client via Ruby Talk and so far, there hasn't been many helpful answers posted.

Ruby Quiz - MUD Client (#45)

Let's generate some. A Quick (and Hopefully Painless) Ride Through Ruby (with Cartoon Foxes) Yeah, these are the two.

A Quick (and Hopefully Painless) Ride Through Ruby (with Cartoon Foxes)

My asthma’s kickin’ in so I’ve got to go take a puff of medicated air just now. Be with you in a moment. I’m told that this chapter is best accompanied by a rag. Something you can mop your face with as the sweat pours off your face. Indeed, we’ll be racing through the whole language. 1.

Rails or Ruby online Code Classes

RegExp. 15 Things for a Ruby Beginner. The following is a post I had recently sent the Bangalore Ruby User Group.

15 Things for a Ruby Beginner

It has been slightly modified to address a larger audience. There were many Ruby beginners in last week's meetup, and the common question we heard was 'after the very basics, what next? ' The best way to learn Ruby best practices is to pair with an experienced dev; the way I learned was by inheriting a reasonably small, but well-written codebase from an amazing colleague.

In the absence of either, here is a checklist of 15 things (since 'N things that you need to know about X' is the in-thing these days!) Bloc. Ruby Weekly Issue 243: April 23, 2015. Ru: Ruby in Your Shell. The venerable sed and awk are extremely powerful text-processing tools.

Ru: Ruby in Your Shell

In the hands of a master, these power tools can bend text into almost any shape and form. Unfortunately, I’m no master. More importantly, I don’t really want to invest too much time into learning sed and awk (or even bash!) , especially when most of my text processing tasks are ad-hoc. Enter Ru. Installing Ru.

Rails

UT on Rails. Last year I held a series of non credit Rails courses for University of Texas Students, i’m happy to announce that i’ve been granted an Adjunct Professor position at the UT and I’m teaching a for credit course in Databases and Rails.

UT on Rails

Lucky for you, i’m a sucker for online learning, so i’ll be putting all my course material online, right here. The Course This Ruby on Rails course is 10 weeks long and assumes you know very little about programming and have not used Ruby, Rails, or Databases previously. The videos are broken up by topic, so if you know one topic you can safely skip that video. Some weeks have exercises and quizes, this is the most important part of the course. I’m taking a fairly non traditional approach to teaching Rails, so even if you’ve been coding for a year or so, you’ll still likely get something out of the course, especially the exercises. Week 1: Introduction to Databases This first week we focus on databases and won’t get into Rails until the second week. More. Ruby for Newbies: Regular Expressions. Ruby is a one of the most popular languages used on the web.

Ruby for Newbies: Regular Expressions

We’ve started a new Session here on Nettuts+ that will introduce you to Ruby, as well as the great frameworks and tools that go along with Ruby development. In this lesson, we’ll look at using regular expression in Ruby. If you’re familiar with regular expressions, you’ll be glad to know that most of the syntax for writing the actual regular expressions is very similar to what you know from PHP, JavaScript, or [your language here]. If you’re not familiar with regular expressions, you’ll want to check out our Regex tutorials here on Nettuts+ to get up to speed. Ruby Regular Expressions. A regular expression is a special sequence of characters that helps you match or find other strings or sets of strings using a specialized syntax held in a pattern.

Ruby Regular Expressions

A regular expression literal is a pattern between slashes or between arbitrary delimiters followed by %r as follows: Syntax: /pattern//pattern/im # option can be specified%r! Ruby Regular Expressions: Ruby Study Notes - Best Ruby Guide, Ruby Tutorial. Regular expressions, though cryptic, is a powerful tool for working with text.

Ruby Regular Expressions: Ruby Study Notes - Best Ruby Guide, Ruby Tutorial

Ruby has this feature built-in. It's used for pattern-matching and text processing. Many people find regular expressions difficult to use, difficult to read, un-maintainable, and ultimately counterproductive. Ruby Classes and Objects. Ruby is a perfect Object Oriented Programming Language.

Ruby Classes and Objects

The features of the object-oriented programming language include: BHUSA09-Tracy-RubyPentesters-PAPER. Learn Ruby The Hard Way. I will now show you how to create a format string, but rather than using variables, use values by their names. Some of this is a bit more advanced, but don't worry you'll learn what all of these mean later. Just type this in, make it work, and write a comment above each line translating it to English. $ ruby ex8.rb 1 2 3 4one two three fourtrue false true false%{first} %{second} %{third} %{fourth} %{first} %{second} %{third} %{fourth} %{first} %{second} %{third} %{fourth} %{first} %{second} %{third} %{fourth}I had this thing. That you could type up right. But it didn't sing. Study this carefully and try to see how I put the formatter inside the formatter. Do your checks, write down your mistakes, and try not to make the same mistakes on the next exercise. Objects - Structure of Ruby objects.

Translated by Vincent ISAMBART Structure of Ruby objects Guideline From this chapter, we will begin actually exploring the `ruby` source code. First, as declared at the beginning of this book, we’ll start with the object structure. What are the necessary conditions for objects to be objects? The ability to differentiate itself from other objects (an identity) The ability to respond to messages (methods) The ability to store internal state (instance variables) In this chapter, we are going to confirm these three features one by one. The target file is mainly `ruby.h`, but we will also briefly look at other files such as `object.c`, `class.c` or `variable.c`.

`VALUE` and object struct In `ruby`, the body of an object is expressed by a struct and always handled via a pointer. Here is the definition of `VALUE`: 15 Things for a Ruby Beginner. RubyMonk - Interactive Ruby tutorials.