Ruby

  • Most Topular Stories

  • How to use Ruby's English "and"/"or" operators without going nuts

    RubyFlow
    26 Aug 2014 | 2:52 pm
    Ruby has both symbolic (&&/||) and English logical and/or operators. The differences between these operators can be confusing, to the point that many programmers simply avoid using the English versions entirely rather than deal with their sometimes surprising behavior. I've made a screencast which explains why the very features which make these operators problematic in a boolean logic setting also make them perfect for certain elegant control flow idioms.
  • Reading Rails - TimeWithZone

    RubyFlow
    28 Aug 2014 | 7:21 am
    Timezones are not fun. Thankfully, Rails largely deals with them behind the scenes. Learn how TimeWithZone works, and when you run into that crazy timezone bug, you'll know where to start looking.
  • Time-Series Database Design with InfluxDB

    Ryan Daigle
    Ryan Daigle
    12 Aug 2014 | 5:00 pm
    Here at Spreedly we’ve recently started using the time series database InfluxDB to store a variety of customer activity metrics. As with any special purpose database, using and designing for a time-series database is quite different than what you may be used to with structured (SQL) databases. I’d like to describe our experience designing our InfluxDB schema, the mistakes we made, and the conclusions we’ve come to based on those experiences. The mark Consider the following scenario, closely resembling Spreedly’s: You run a service that lets your customers transact…
  • The Future of Consulting

    Obie Fernandez
    Obie Fernandez
    5 Aug 2014 | 11:12 am
    I am doing an online (live) panel discussion with special guests a little less than an hour from now. https://www.airpair.com/airconf2014/keynote/future-of-consulting Here is a brief list of topics that we hope to cover: - state of software consulting today. static? growing? - what are the external forces shaping change in the industry? - opportunities of ongoing engagement outside traditional project-based models - should firms be looking to unbundle services? - or additional bundling and/or co-promotion of educational and othe rservices (ala Thoughtbot) - what is the proper balance of…
  • The Case for Buying Technical Books

    Jay Fields' Thoughts
    Jay Fields
    25 Aug 2014 | 1:50 pm
    In the past few months I've seen more than a few articles encouraging programmers to write books. Each article provides at least a bit of good advice, and proceeds to conclude with the same idea:You should write a book to build your brand.I find this conclusion accurate and extremely disappointing. If the overwhelming reason to write a book is brand building, then the pool of potential authors is restricted to people who would benefit from brand building (and people who don't value their time).How Did We Get Here?The Internet, obviously. Practically everyone knows how to download any movie,…
  • add this feed to my.Alltop

    RubyFlow

  • Reading Rails - TimeWithZone

    28 Aug 2014 | 7:21 am
    Timezones are not fun. Thankfully, Rails largely deals with them behind the scenes. Learn how TimeWithZone works, and when you run into that crazy timezone bug, you'll know where to start looking.
  • Paperdragon: Explicit Image Processing

    28 Aug 2014 | 3:15 am
    Paperdragon is a new alternative to Paperclip and CarrierWave. Its very explicit API uses Dragonfly under the hood and gives you control about every aspect for processing uploaded images.
  • How you can implement living documentation

    27 Aug 2014 | 5:49 pm
    This is part 3 in my series about living documentation. Here I discuss effective ways to implement end-to-end tests. Part 2 discussed how we can write better living documentation, and Part 1 discussed why you should give living documentation a chance.
  • Ruby version usage in commercial projects, 2014 edition

    27 Aug 2014 | 5:38 am
    Following up on last year's report, here's a chart of Ruby versions used in commercial projects, sourced from Semaphore CI.
  • How to use Ruby's English "and"/"or" operators without going nuts

    26 Aug 2014 | 2:52 pm
    Ruby has both symbolic (&&/||) and English logical and/or operators. The differences between these operators can be confusing, to the point that many programmers simply avoid using the English versions entirely rather than deal with their sometimes surprising behavior. I've made a screencast which explains why the very features which make these operators problematic in a boolean logic setting also make them perfect for certain elegant control flow idioms.
 
  • add this feed to my.Alltop

    Ryan Daigle

  • Time-Series Database Design with InfluxDB

    Ryan Daigle
    12 Aug 2014 | 5:00 pm
    Here at Spreedly we’ve recently started using the time series database InfluxDB to store a variety of customer activity metrics. As with any special purpose database, using and designing for a time-series database is quite different than what you may be used to with structured (SQL) databases. I’d like to describe our experience designing our InfluxDB schema, the mistakes we made, and the conclusions we’ve come to based on those experiences. The mark Consider the following scenario, closely resembling Spreedly’s: You run a service that lets your customers transact…
  • The New Gist: What It Is and What It Could Be

    Ryan Daigle
    12 Dec 2012 | 4:00 pm
    Gist is an incredible tool by Github for quickly sharing code, text and files. It has syntax highlighting and rendering for a huge number of programming languages including Markdown for text. For many techies, including myself, Gist is an indispensable tool for quickly sharing code and content with coworkers. Gist has been around for several years now and, when compared with the pace of development on the main Github.com property, has been relatively neglected. Thankfully, Github recently updated Gist with a fresh new codebase and UI. As a heavy user of Gist I have some thoughts on this…
  • Site Relaunch

    Ryan Daigle
    7 Feb 2012 | 4:00 pm
    I’m currently in the middle of putting a fresh coat of paint on RyanDaigle.com, the previous home of the What’s new in Edge Rails series. All old links to http://ryandaigle.com/articles will be redirected to an archived version of the site at http://archives.ryandaigle.com. I doubt all links will make the change, but I’ve given it my best effort. Don’t have any big plans for the site beyond a renewed effort at writing more. Stay tuned.
  • add this feed to my.Alltop

    Obie Fernandez

  • The Future of Consulting

    Obie Fernandez
    5 Aug 2014 | 11:12 am
    I am doing an online (live) panel discussion with special guests a little less than an hour from now. https://www.airpair.com/airconf2014/keynote/future-of-consulting Here is a brief list of topics that we hope to cover: - state of software consulting today. static? growing? - what are the external forces shaping change in the industry? - opportunities of ongoing engagement outside traditional project-based models - should firms be looking to unbundle services? - or additional bundling and/or co-promotion of educational and othe rservices (ala Thoughtbot) - what is the proper balance of…
  • How to Write and Publish a Technical Book (and make lots of money)

    Obie Fernandez
    28 Apr 2014 | 5:56 pm
    Over the course of the last few years, the tech publishing market has changed. Authors are in a much better position than ever before. If you are serious about success as a technical author, here are your up-to-date instructions. As long as your content is solid and valuable to your audience, I believe this is how you make the most money. You'll also reap serious long-term benefits. First of all, are you talking to a publisher about a book deal already? Maybe you have a book proposal and/or outline in hand already? Good. That's a good starting place, but it's time to get in the driver's seat.
  • 8 Apr 2014 | 3:41 pm

    Obie Fernandez
    8 Apr 2014 | 3:41 pm
    Glad to announce that my latest book, The Lean Enterprise, is now widely available in print and Kindle editions on Amazon. Getting lots of great reviews already!
  • TechPeaks: Startup Life in the Italian Alps

    Obie Fernandez
    7 Jan 2014 | 6:00 am
    Last summer (2013) I was honored with an invitation to serve as a mentor for the inaugural group of entrepreneurs welcomed into the TechPeaks accelerator program. It opened my eyes to what's possible when a progressive local government achieves effective cultivation of innovation and startups. Quite an experiment the Italians pulled off last year, and the results have encouraged them to do it again this year, with notable evolutions to their program that I believe make it an even better opportunity for aspiring entrepreneurs. Here's one of the coolest aspects of it, that really sets this…
  • Robert Williams, man to watch in 2014

    Obie Fernandez
    1 Jan 2014 | 10:23 am
    I recently interviewed Robert Williams, founder of Workshop. Over the course of the last year Robert went from full-time employment, to successful freelancing, to launching a successful online business helping other freelancers to succeed using his methods. What is your background? My background is in design. I went to an expensive art school - which I now regret, because 90% of the education I use on a daily basis is stuff I learned online (mostly for free). I worked at a few design agencies after college, then in the marketing department for a large nursery - but those jobs left me…
 
  • add this feed to my.Alltop

    Jay Fields' Thoughts

  • The Case for Buying Technical Books

    Jay Fields
    25 Aug 2014 | 1:50 pm
    In the past few months I've seen more than a few articles encouraging programmers to write books. Each article provides at least a bit of good advice, and proceeds to conclude with the same idea:You should write a book to build your brand.I find this conclusion accurate and extremely disappointing. If the overwhelming reason to write a book is brand building, then the pool of potential authors is restricted to people who would benefit from brand building (and people who don't value their time).How Did We Get Here?The Internet, obviously. Practically everyone knows how to download any movie,…
  • Solitary Unit Test

    Jay Fields
    16 Jul 2014 | 12:55 pm
    Originally found in Working Effectively with Unit TestsIt’s common to unit test at the class level. The Foo class will have an associated FooTestsclass. Solitary Unit Tests follow two additional constraints: Never cross boundaries The Class Under Test should be the only concrete class found in a test. Never cross boundaries is a fairly simple, yet controversial piece of advice. In 2004, Bill Caputo wrote about this advice, and defined a boundary as: ”...a database, a queue, another system...”. The advice is simple: accessing a database, network, or file system significantly increases…
  • Working Effectively with Unit Tests Rough Draft Complete

    Jay Fields
    30 Jun 2014 | 5:48 pm
    I finally put the finishing touches on the rough draft of Working Effectively with Unit Tests. It's been an interesting journey thus far, and I'm hoping the attention to detail I've put into the rough draft will translate into an enjoyable read. What I did poorly: I'd written the book's sample before I ever put it on leanpub. Before a book is published you can collect contact and price information from those who are interested. However, once you publish and begin selling, you no longer have the ability to collect the previously mentioned information. I published and began selling my book…
  • Working Effectively with Unit Tests

    Jay Fields
    21 May 2014 | 4:29 am
    Unit Testing has moved from fringe to mainstream, which is a great thing. Unfortunately, as a side effect developers are creating mountains of unmaintainable tests. I've been fighting the maintenance battle pretty aggressively for years, and I've decided to write a book that captures what I believe is the most effective way to test. From the PrefaceOver a dozen years ago I read Refactoring for the first time; it immediately became my bible. While Refactoring isn’t about testing, it explicitly states: If you want to refactor, the essential precondition is having solid tests. At that time, if…
  • Weighing in on Long Live Testing

    Jay Fields
    19 May 2014 | 9:52 am
    DHH recently wrote a provocative piece that gave some views into how he does and doesn't test these days. While I don't think I agree with him completely, I applaud his willingness to speak out against TDD dogma. I've written publicly about not buying the pair-programming dogma, but I hadn't previously been brave enough to admit that I no longer TDD the vast majority of the time. The truth is, I haven't been dogmatic about TDD in quite some time. Over 6 years ago I was on a ThoughtWorks project where I couldn't think of a single good reason to TDD the code I was working on. To be honest,…
  • add this feed to my.Alltop

    パズドラの裏ワザで最強プレイヤーへの道

  • パズドラの裏ワザで

    admin
    25 Aug 2014 | 1:09 am
    パズドラが強くて有名な人って男性が多いイメージ。 女性の私だってパズドラ強くなって有名になりたい!www ・・・ということで裏ワザを使って強くなろうと思いまして。 だって普通にプレイしていたら有名になるくらい強くなるなんて無理だし。 なぜならするには何十万円と課金しなくてはいけないし、寝る時間を削ってまでパズドラをしなくちゃいけない・・・…
 
  • add this feed to my.Alltop

    Polishing Ruby + Software Releases - zenspider.com

  • oedipus_lex version 2.4.0 has been released!

    ryan davis
    29 Aug 2014 | 5:50 pm
    Oedipus Lex is a lexer generator in the same family as Rexical and Rex. Oedipus Lex is my independent lexer fork of Rexical. Rexical was in turn a fork of Rex. We’ve been unable to contact the author of rex in order to take it over, fix it up, extend it, and relicense it to MIT. So, Oedipus was written clean-room in order to bypass licensing constraints (and because bootstrapping is fun). Oedipus brings a lot of extras to the table and at this point is only historically related to rexical. The syntax has changed enough that any rexical lexer will have to be tweaked to work inside of…
  • minitest-bisect version 1.0.0 has been released!

    ryan davis
    29 Aug 2014 | 5:40 pm
    Hunting down random test failures can be very very difficult, sometimes impossible, but minitest-bisect makes it easy. minitest-bisect helps you isolate and debug random test failures. If your tests only fail randomly, you can reproduce the error consistently by using --seed <num>, but what then? How do you figure out which combination of tests out of hundreds are responsible for the failure? You know which test is failing, but what others are causing it to fail or were helping it succeed in a different order? That’s what minitest-bisect does best. Changes: 1.0.0 / 2014-07-16 1…
  • minitest-gcstats version 1.0.0 has been released!

    ryan davis
    29 Aug 2014 | 5:36 pm
    A minitest plugin that adds a report of the top tests by number of objects allocated. Changes: 1.0.0 / 2014-08-29 1 major enhancement Birthday! home: https://github.com/seattlerb/minitest-gcstats rdoc: http://docs.seattlerb.org/minitest-gcstats
  • ruby2ruby version 2.1.2 has been released!

    ryan davis
    28 Aug 2014 | 3:37 pm
    ruby2ruby provides a means of generating pure ruby code easily from RubyParser compatible Sexps. This makes making dynamic language processors in ruby easier than ever! Changes: 2.1.2 / 2014-08-28 1 bug fix: Fixed readme to point out that deep_clone may be needed. (heathd) home: https://github.com/seattlerb/ruby2ruby rdoc: http://seattlerb.rubyforge.org/ruby2ruby
  • minitest version 5.4.1 has been released!

    ryan davis
    28 Aug 2014 | 3:33 pm
    minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking. "I had a class with Jim Weirich on testing last week and we were allowed to choose our testing frameworks. Kirk Haines and I were paired up and we cracked open the code for a few test frameworks... I MUST say that minitest is *very* readable / understandable compared to the 'other two' options we looked at. Nicely done and thank you for helping us keep our mental sanity." -- Wayne E. Seguin minitest/unit is a small and incredibly fast unit testing framework. It provides a rich set of…
  • add this feed to my.Alltop

    Vinsol - Ruby on Rails, iOS, Android Consulting and Development

  • Compiling native libraries for Android L

    Hitesh Sondhi
    19 Aug 2014 | 7:32 am
    Preparing your app for Android L ? While using native executables in our existing Android apps we observed that those executables were no more working with Android L. We came to know that Android has introduced one more security feature starting from Android L i.e Executable must be PIE (Position independent executable). To compile a library adhering to above security feature you just need to follow these steps: Set following LDFLAGS or linker flags : -pie -fPIE Add --with-pic option while configuring the library. Some libraries might use different configure options to compile the code with…
  • Bubble Validations

    Divya
    14 Aug 2014 | 8:02 am
    We were developing a Content Management System which is composed of different components, with each component having dependency on other components in the hierarchy. Our CMS has the following structure : Site has_many pages Page has_many sections Section has_many embedded_modules EmbeddedModule has_many elements Problem Statement For any component to be publishable, we need to ensure that not only a particular component, but also its descendants(children) should satisfy the criteria of publishability. In our case a Page could be publishable, if all sections belonging to it were publishable. A…
  • Spree Loyalty Points Extension

    Mayank Tandon
    12 Aug 2014 | 6:20 am
    Most online stores thrive on customer satisfaction and their loyalty towards their stores. In order to improve the long term relationship with the customers and earn their loyalty, stores come up with different ideas to keep customers engaged. One such idea is to award loyalty points to the customer based on their purchases. These awarded points can be used by customers as a discount in their future purchases. Understanding the need, we recently published this new extension “Spree Loyalty Points” which adds the loyalty points functionality into the existing e-commerce system. With…
  • Cross Compiling FFmpeg with x264 for Android

    Hitesh Sondhi
    30 Jul 2014 | 4:07 am
    Recently we were working on a feature where we had to combine an image and audio to create a video on mobile devices. In iOS this can be done using AVAssetExportSessionthough – for detail see this link However, we could not find any native solution for this problem in Android. FFmpeg is one such tool to tackle this problem but it is not available for Android officially. We tried few existing Android ports of FFmpeg but they were either outdated or didn’t work for us. So we planned to fold our sleeves and compile the library for Android. Compiling libraries on Linux system is a fairly…
  • Vinsol Introduces ShopSpree: First iOS App for Spree Commerce

    Mayank Tandon
    24 Jul 2014 | 3:31 am
    We understand the preferences of shoppers have changed globally. Today, consumers prefer shopping in the most convenient ways: anywhere, anytime and on the move. This changing landscape has given birth to the world of mobile and applications. The statistics prove the increase in mobile internet usage is on the rise, now standing at 65% globally. Around 32% of all online purchases have been done through mobile. Mobile commerce is looking promising, and expects the spending to be $200 billion USD by the end of 2014, reaching an approximate 50% growth from 2013. Predictions indicate that by…
  • add this feed to my.Alltop

    Ruby-coloured glasses

  • Life at 38

    Taryn East
    24 Aug 2014 | 5:11 pm
    When I was 5 I liked to do jigsaw puzzles upside down (to make it harder) and blow bubbles off the balcony -- watching them drift over the street. I liked to walk to school by myself (one block) and learn Origami from the lady in the flats behind us. When I was 7 I wished on every star that I could have a baby sister. When I was 8, I got one. When I was 10 I liked to explore the backways of Oyster Bay, picking flowers to make perfume (which smelled terrible). I played fantasy make-believe games with my cousins - involving magic and unicorns, where we saved the world. When I was 12 I got…
  • STOP YELLING! or how to validate a field isn't in ALLCAPS

    Taryn East
    18 Aug 2014 | 6:11 pm
    TuShare lets people give away things they no longer need. It turns out that some people think that putting their headings in ALLCAPS will get more attention... but we think it just annoys people (nobody likes to BE YELLED AT!). Here's a quick snippet that lets you validate that your users aren't YELLING AT YOU! in any given field. 1) create a custom validator in app/validators/not_allcaps_validator.rb with the following code: # we don't want our users YELLING AT US! class NotAllcapsValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) if value.present? &&…
  • Link: Why I am leaving the best job I ever had

    Taryn East
    12 Aug 2014 | 6:09 pm
    an awesome post by Max Schireson to remind us of our priorities in life: Why I am leaving the best job I ever had "Earlier this summer, Matt Lauer asked Mary Barra, the CEO of GM, whether she could balance the demands of being a mom and being a CEO. The Atlantic asked similar questions of PepsiCo’s female CEO Indra Nooyi. As a male CEO, I have been asked what kind of car I drive and what type of music I like, but never how I balance the demands of being both a dad and a CEO..."
  • Link: Guidelines for growing a stable codebase

    Taryn East
    6 Aug 2014 | 4:55 pm
    "Software projects need to evolve over time, but they also need to avoid collapsing under their own weight. This balancing act is something that most programmers understand, but it is often hard to communicate its importance to nontechnical stakeholders. Because of this disconnect, many projects operate under the false assumption that they must stagnate in order to stabilize. "This fundamental misconception about how to maintain a stable codebase has some disastrous effects: it causes risk-averse organizations to produce stale software that quickly becomes irrelevant, while risk-seeking…
  • 10K on Stack Overflow

    Taryn East
    31 Jul 2014 | 4:50 pm
    w00t! This morning I finally got the 10k moderator tools privilege on StackOverflow. You can see it here: Taryn East on Stack Overflow Pardon me while I blow my horn for a moment, but it's taken me nearly five years to get here...
 
  • add this feed to my.Alltop

    Masteruby

  • How to Add User Karma in Rails

    11 Aug 2014 | 5:00 pm
    A week ago you’ve learned how to add voting. Acts_as_votable is great, but it doesn’t provide user karma. This time you will learn how to add user karma functionality to your app. What do you need Links controller and model created User authentication created Acts_as_votable gem Adding karma column to users table To use karma for user, we need to generate new migration. Create new migration like this: rails generate migration AddKarmaToUsers Let’s edit it now. db/migrate/add_karma_to_users.rb class AddKarmaToUsers < ActiveRecordMigration def change add_column :users :karma :integer…
  • How to Add Comments to Rails App with Commontator

    7 Aug 2014 | 5:00 pm
    Last time we’ve added voting. This time I will show you how easy can be adding comments with Commontator. Why to Use Commontator Commontator has following advantages: It includes comments count Is easy to configure It includes creating, editing and deleting comments You can add voting with acts_as_votable Is customizable How to Install Commontator First thing we need to do is to add commontator gem to Gemfile Gemfile gem 'commontator' Then install it with Bundler bundle install Now you can create Commontator configuration and migrations rake commontatorinstall And move migrations to…
  • How to Add Voting to Rails App

    4 Aug 2014 | 5:00 pm
    In this post I want to show to add upvotes and dowvotes using acts_as votable gem. What do You Need Basic Authentication with current_user helper(Devise or something else) One model with name Link and controller links acts_as_votable gem installed How to setup acts_as_votable Add gem acts_as_votable to your Gemfile. Gemfile 'acts_as_votable' And install it with bundle bundle install Now generate acts_as_votable migration rails generate acts_as_votable:migration And migrate to database rake db:migrate Now we’re done with preparation let’s add upvote action. Adding upvotes First…
  • How to convert Ruby source code to pdf in Linux

    8 Jul 2014 | 5:00 pm
    In this post I want to show to convert source code to pdf using Linux. We’ll use file base.rb from Sinatra framework as example. Converting Ruby source code to HTML First thing we need to is to convert our source code to html. To convert it we’ll use code2html. Install it right now: sudo apt-get install code2html We want to convert base.rb file from Sinatra source code. We want to include line numbers in our conversion so we’ll use flag -n to add them. Let’s convert it. code2html -n base.rb base.html Code2html will take work for conversion. Look at our converted file in browser.
  • How to create digital clock in Ruby Shoes

    28 Jun 2014 | 5:00 pm
    In this post I want to show how to create digital clock using Shoes. Clock is first in following series of tutorials about using Time library in Shoes. Next time we’ll look at stopwatch and timer. You can find out example code on github Here’s what we’ve in front of us. First we’ll add current time with Ruby Time library and append in to title element Then we’ll add automatic update to current time And we’ll add some styling to our clock Adding current Time to our app. First thing we need to do is add current time. We’ll use Time library for this. Create ruby file clock.rb and…
Log in