Can you tell the difference between good and bad code? What do you base your judgment on?
Over the years, the Ruby community has built a fairly strong notion of “the right way” of writing code. During his thought provoking presentation, Matt will show that things are not simply good vs bad, and that what we call “pretty” code might, in fact, just be lipstick on a pig.
Like any other software, MRI has bugs. In this talk, Charlie will dive deep into the internals of MRI and demonstrate how a few interesting bugs can be leveraged to do crazy things you never thought were possible in Ruby.
Everyone casts the "Enterprise" as the most horrid place in the world to be a Ruby developer, and they used to be right. How does a Rubyist trying to stay current work in a confined and archaic environment with strict security restrictions? You do everything other Rubyists do, but you do it without sudo and from source. Together we'll identify the best open source self-hosted options for agile managment, provisioning, git hosting, error tracking, CI, isolated RVM, metrics, central logging, and security. As a bonus, you'll learn how to automate the setup of all these tools as much as possible without sudo privileges.
By now you probably know that RubyMotion is a new toolchain that lets you use familiar Ruby techniques to develop applications for iOS… but do you know what makes it tick? How is RubyMotion different from toolchains such as PhoneGap or Titanium? What does it mean to say that RubyMotion is implemented "on top of the Objective-C runtime"? And how the heck do I debug RubyMotion anyway?
I will attempt to answer these questions, and more, by looking deep into the underpinnings of RubyMotion. Along the way, I'll give a bit of an overview of the history of RubyMotion, and maybe even a glimpse at its future.
ActiveRecord is complex code and because of complexity it has edge cases. In fact lots of edge cases. We will take a look at a number of ActiveRecord features to see how it works and how to deal with some of the edge cases.
We will see how default_scope works. And why method "unscoped" removes default_scope from models but not from associations.
Do you know the difference between CollectionProxy and Relation ? Do you know why in a has_many through case "@physician.patients.create!" would work but "@physician.patients.where(active: true).create! would silently fail without creating the association record?
We will discuss why while patching Active Record you should run your tests against all three databases.
Guess which of these two obey :destroy option: @customer.orders.delete(@order) or @customer.orders.destroy(@order).
In Rails 3 when where conditions are merged then the last where condition wins. In Rails 4 all the where conditions are 'And'ed. But not defautl_scope. We will see how and why.
Will also discuss implementation detail of features like inverse_of, autosave and callbacks.
A well-designed DSL improves programmer productivity and communication with domain experts. The Ruby community has produced a number of very popular external DSLs--Coffeescript, HAML, SASS, and Cucumber to name a few.
Parslet makes it easy to write these kinds of DSLs in pure R ou’ll learn the basics, feel out the limitations of several approaches and find some common solutions. In no time, you’ll have the power to make a great new DSL, slurp in obscure file formats, modify or fork other people’s grammars (like Gherkin, TOML, or JSON), or even write your own programming language!
How can you know if your Rails app is safe? With potential vulnerabilities lurking in your app's code, in gems you depend on, in services you use, and in the Rails source itself, attackers have myriad vectors to gain access to your data, interrupt your service, and damage your reputation.
I'll cover the basics of securing your Rails app, evaluating and mitigating the risk inherent in live web applications, and strategies for keeping your app secure as new threats emerge.
Coming up with a good name is one of the hardest things to do in programming. It's one of the least technical things we do, but it has one of the largest impacts on how understandable our code is. Ruby is a very expressive language, which makes it very suitable to naming things well and thereby making maintenance easier. This talk will go over more than just how to name variables and classes: it will show how to extract and name concepts, processes, and procedures from existing code in order to understand it better.
As a freelancer I'm often tasked with creating high quality web applications quickly while keeping the budget razor thin. In my experience, the absolute best bang-for-your-buck style of development has been BDD from the outside-in via acceptance tests. With acceptance tests you can quickly and accurately determine the minimum code necessary to fit the requirements of an application while achieving high code coverage and resilience to refactoring. By their very nature acceptance tests are the the simplest kinds of tests to write since they are expressed in the language of an end-u e'll implement a feature from the outside-in, explaining the reasoning behind every step.
How we call methods in a dynamic language like Ruby is complicated and fascinating. This talk dives into one slice of Ruby internals, the inline method cache. We'll walk through MRI's awesome but sometimes quirky method caching. And we'll go through some practical improvements we've made in
Ruby-Processing is a simple wrapper for the Processing framework that combines the visual-driven environment of Processing with the fun of writing R we'll go through the ways to "sketch" with Ruby-Processing with several live coding examples and create something together. Through creativity, we can increase the breadth of problems we can solve in our day to day jobs.
Not sure where to cluster or where to classify? Have you seen a linear regression lately? Every wanted to take a look into machine learning? Curious to what problems you can solve? Using Ruby to become familiar with machine learning and data-mining techniques is great way to get acclimated before diving in with both feet.
Traditional programming languages use a model of computation where individual instructions are executed in order. However, when building distributed systems this model fails to match the reality of how your application code is actually executed. Bloom is a language which allows programmers to build applications as a series of unordered statements while also providing facilities for imposing a particular ordering of events when necessary.
During this talk we will explore building applications in Bud, which is a prototype of Bloom implemented as a domain specific language in Ruby. We will discuss the concepts of logical monotonicity, disorderly collections, the CALM principle which is the root of the Bloom language, and how to use he Bloom language to identify critical sections of your code where a coordiation library should be used to ensure consistency.
Introducing programming to young people is a balancing act. What language to use? Bore the quickest students, or leave some behind? Teach them style, or let them discover their own? At Lincoln Sudbury Regional High School, Ruby has helped us bring our Intro to Programming course to a new sweet spot, where students leave the one semester course with a bit of knowledge and a lot of enthusiasm, filling our upper level programming courses and learning more on their own.
As Rubyists we often pride ourselves on our elegant, terse, clever code. When we teach our students, we keep it simple. Simple conditionals, simple loops and iterators. This allows us to get more quickly to a place where students can express their creativity. And thats what gets them hooked.
Testing is an important part of the development lifecycle of any software solution. It is particularly important in the Ruby community with lots of real and perceived pressure to test first, test often and test fully (or at least 90% coverage, right?). However, there has not been as much focus on the why of testing as a mechanism to encourage good code practices, good design decisions and coverage that is meaningful. This presentation aims to change all that. I will start with a brief overview of ruby testing: the why, what, how, when and where. For the rest of the presentation, I will take the Fibonnaci sequence and deconstruct it via a tongue-in-cheek approach to showcase why Good Testing™ is so much more important than Testing… and why tests should force the developer to think deeper about their code… not just as implementation but as behavior!
Ever wondered about market trading, analytics or algorithms but didn't want to lose your shirt experimenting? EVE Online is a Massively Multiplayer Online Role Playing Game (MMORPG) rich in data with a fully functional, player driven economy. Using some simple concepts and novel tools you can get access to this data and discover interesting I'll introduce you to market analytics and the cruel world of EVE Online.
Underneath the beautiful veneer of our Ruby libraries lies a twisted tangle of writhing guts. Maybe you're curious how the pieces fit together or maybe you're tracking down a bug, either way it's easy to get lost in the blood and bile that ties our code toget ou'll learn how to use simple and sharp Ruby tools to slice into large libraries with surgical precision. Turn your impossible bugs into pull requests, and level up your programming skills by Dissecting Ruby with Ruby.
You've been able to serialize Ruby objects with ActiveRecord in the past, but the database treats serialized objects as text. PostgreSQL has support for advanced data types, like arrays, hashes and ranges, natively, allowing the database to do the heavy work for you. You can query a table for records that contain an array with a specific element. You can build a reservation system in which the database makes sure that you don't double book a room. All of which happens in the database, preventing you from retrieving extra records and processing them in memory.
With Rails 4, ActiveRecord has been supercharged. The PostgreSQL adapter has been extended to support arrays and hashes, and was rewritten to make adding your own types easier than before. There are gems out there that allow you to leverage these datatypes in Rails 3 as well.
You probably use Ruby everyday, so why not use Ruby to automate some common tasks? What if you could spin up an EC2 instance and have it automatically configure your web server, database, users, and more? What if you could effectively capture and replicate your production environments reliably and consistently? What if you could then give developers production-like environments as Virtual Machines, with no additional work? What if you could set up your new laptop with multiple Ruby versions, your favorite software, and even change the desktop background - from a single command? The good news is - you can!
Chef is a configuration management and automation tool that solves these problems and many m you'll learn common just how easy it is to capture your infrastructure in Chef. Save time and money by using Chef's Ruby DSL to "define" your laptop.
How many times have you bought a new laptop and realize just how much stuff you installed over the years? If you're using Chef, run a single command and all your favorite Applications, Preferences, and even passwords are back in place. And the best part - because Chef is written in Ruby, you get to continue using the language you love!
15 years ago, Justin looked forward to the day when he could have a stack of expensive audio equipment with speakers in every room, lights that follow him around, and an intercom system so the family could page each other like Tim "The Tool Man" Taylor.
Ubiquitous networking, APIs for consumer electronics, and cheap computers like the Raspberry Pi have made it easier than ever to automate your home. We go over some popular technologies, see some code to glue it all together, and watch a live demo of some of Justin's favorite house hacks.
JRuby is the primary alternative implementation of Ruby available. With support for native threads, excellent garbage collection, and the introduction of Invoke Dynamic it has grown into a formidable platform. So, what can JRuby do for you? Learn how JRuby differs from MRI, how JRuby supports parallelism, how to use Java libraries from JRuby, how to use Ruby from Java and more. Java no longer means just the language anymore, the JVM is an excellent place to host Ruby applications.