RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

mattetti — 44 posts

http://merbist.com

I just wrote an explanation about sharing Rails sessions with non-Ruby apps and what I discovered in the process..
Turns out, Rails cookies can be dangerous and they don't play nice with others.

Signed and encrypted cookies (sessions, remember me etc..) are serialized using Marshal which is problematic for two reasons: security (someone with the session key can execute arbitrary code server side)and compatibility (you can't share a session with a non Ruby app).

You can't currently change Rails default serializer, but here is a monkey patch for Rails 4. And here is a discussion about changing Rails default serializer.

Please consider helping with the pull request the Rails team wants us to come up with.
Here is a tour of programming languages you might want to consider for your next big project. With a list of pros/cons.
I wrote a practical guide for StatsD/Graphite if you are interested in running your own NewRelic, dig deeper in your data, or want to improve your graphite skills, you might be interested in reading this article.

(bonus: Ruby code sample showing how to instrument your code base)
Ruby 2.0 has a brand new feature very few people talked about: TracePoint. This Ruby 2.0 TracePoint example shows how to use this new feature to look at what Rails does when she handles requests. More specifically what classes and methods are used and how often.
I just released something most of you probably won't need:
A Ruby HTTP client that fires requests but doesn't wait for responses.
You could think of it as HTTP over UDP but with the first connection being verified. Basically, the client opens a TCP connection, sends its payload, and disconnects -- letting the server just "deal with it".

I also added a way a way to check on the response if you want to debug, delays can also be added... see the readme
Getting OmniAuth + Google Apps working properly together isn't that hard as long as you're are of two key things. To help you waste time like I did, here is quick run through guide to get you up and running.
Real life concurrency in Go  matt.aimonetti.net
Concurrency is a hot topic in the Ruby community, so taking a look at how other languages/communities approach the challenge can be very valuable. This is exactly what I did in this blog post showing how to write concurrent code in Go.
Even though we live in a very lucky time for software engineers, most of us have a hard time building a career and picking the right jobs, read why we suck at that, my own experience and pointers to help you find a career direction.
mmm... mruby everywhere  matt.aimonetti.net
Here are my Aloha RubyConf slides on mruby (minimalistic Ruby). If you are interested in embedding mruby, checkout this simple Rakefile showing how to compile/embed Ruby code in a C wrapper. Finally, on the mruby topic, I previously wrote 2 other posts: Getting started with mruby and mruby and mobiruby (Ruby for iOS)
I wrote an overview of some of the basic Ruby constructs such as class, module and mixin.
I just wrote a quick explanation with examples of the differences between copying and cloning a Ruby object. I've also added a quick explanation of shallow object copying.
Rethinking web API development  matt.aimonetti.net
Here is an article aboutrethinking web API development.
I started a collection of helpers and wrappers for RubyMotion making some ObjC APIs a bit more familiar to Ruby developers. Here is the GitHub repo feel free to watch or/and fork and send pull requests.
The goal being to provide a rich library of various helpers and wrappers for educational purpose and to simply RubyMotion developers life.
I wrote a review of RubyMotion, a new toolchain for iOS based on MacRuby.
Getting started with mruby  matt.aimonetti.net
Learn what makes mruby different and how to get started embedding Ruby in a C program by reading this mruby blog post.
Appcelerator Titanium employee Yuichiro MASUI announced mobiruby. For a review of MobiRuby check out this blog post.
Matz and his team released mruby source code on GitHub. For more details on what mruby is, check out this blog post.
My take on mruby and MobiRuby  matt.aimonetti.net
Many people asked me what I thought of the announcement of Matz's new Ruby implementation and the first real life use of it: MobiRuby, allowing Ruby developers to write iOS apps.
Here is my take on these two projects.
In my latest blog post I show how to implement a SSO solution.
For more than a year now, I've been developing a DSL to write web services. The DSL has been used in production on major PS3 games and other web applications. To help people getting started with the DSL, I released a 'mini-framework'/example application using the DSL on top of Sinatra, check it out.

If you are already familiar with the Grape DSL, it's the same concept but with the following advantages:

input validation/sanitization
service isolation
generated documentation
contract based design


Note that while this version of the mini-framework uses sinatra as a web engine, the DSL could be used directly on top of Rack, Goliath and potentially Rails 3 (or 4).
I compiled a list of things Rails didn't/doesn't do right in the hope that we can learn from our mistakes.
I wrote a tutorial on using HTTP caching and JavaScript to easily increase the throughput of your servers. It should be specially interesting to you if you are hosting on Heroku (Varnish) is setup or if you are using Rack-Cache or planning on doing so.
I just wrote a blog post trying to cover what it means to design for scalability.
I just blogged about relationship between cause and effect when trying to make a system scalable. The article shows that the scalability challenge is not new and not exclusive to the tech world. It shows the traditional approach to scaling and as well as the challenge of scaling in relation to the web and what to be aware of when planning to make a solution scalable.

The article also shows how some popular scalable approaches like switching to the Amazon Web Services might not help you scale.
I just updated my MacRuby book which you can purchase in electronic format, preorder discounted from Amazon or read online for free. This blog post explains what was updated and what's coming up next.
Here is a summary of the many discussions I had with a Java developer who switched to Ruby. Topics addressed: Threads / Concurrency; Rails is slow; Object allocation / Garbage Collection; Tools; ActiveRecord; Tools; What can we do?
I posted an article talking about my choice to write an open licensed book for MacRuby and why open licensed books matter.
The draft version of the book can be found here.
I (Matt Aimonetti) posted a blog post addressing the problem of doing it wrong and technologies that suck.
Here is an interesting blog post to show how to speed up your Rails XML responses by adding some tenderlove to your code.
Matt just announced he's giving up his life as a free agent to join Sony PlayStation. Is he going to wear a tie, code in Java, spend hours in meetings? Does this mean that Ruby is now mainstream? Read more to find the answers to these existential questions and hear about the reasons behind his decision.
Undo/Redo in MacRuby  merbist.com
Matt Aimonetti just posted a simple MacRuby tutorial showing how to use Cocoa's built-in classes to implement undo/redo and use the functionality in a simple Ruby script.
MacRuby 0.5 just got released read what changed since last beta. Summary: HotCocoa is now a separate gem, better AOT compilation, GCD API.
I'm sure that like everyone else, your main concern in life is to detect cylons around you. Good new fellas, Matt Aimonetti wrote a blog post that will help you do that using MacRuby. Well, not really, but kinda... At least, you will learn from his blog post that the work on MacRuby 0.6 started and an early version of a debugger is now available to play with.
Matt Aimonetti posted a tutorial explaining how to control iTunes using MacRuby. If you've always wanted a better way to create playlist or rename, tag, edit your music, you might be interested in reading this article.
Matt Aimonetti wrote another example of how to use MacRuby for something you might not have thought of. This time he shows how to programmatically change your iChat status to display a countdown to 2010.
Matt Aimonetti just posted a short blog post showing how to detect the language of a string with MacRuby in less than 10 LOC. "Happy new year!".language # => "en"
MacRuby 0.5 beta 2 just got released, read the official blog post.
After all the comments left on my My Ruby Revolution is over post, I decided to post a follow up.
Read more...
The MacRuby team just released MacRuby 0.5 beta 1 with a lot of improvement and features. After downloading the beta, go play with one of the first MacRuby specific gems and imagine what kind of new projects you will soon be able tow ork on.
Learn how to do easily do Cocoa stuff with MacRuby. Matt Aimonetti just started posting a series of MacRuby tips, the first two ones: embedding a custom font and Playing an audio file.
Matt Aimonetti covers the latest modifications on MacRuby trunk just before the first Beta/RC of 0.5 gets released.
Matt Aimonetti walks through the new merb-freezer plugin and explains why, when and how to freeze a Merb app.