Ruby

  • Most Topular Stories

  • Integrate web templates in Rails application

    RubyFlow
    1 Mar 2015 | 3:02 pm
    In this blog I talked about how to integrate web templates from wrapbootstrap into rails application
  • View components in Rails

    RubyFlow
    1 Mar 2015 | 1:17 pm
    I looked at different options for implementing view components in Rails. The article discusses Arbre, Cells and vanilla Rails options such as partials.
  • Mazes for Programmers: Beta!

    The Buckblog
    Jamis
    3 Feb 2015 | 11:00 pm
    The author announces the beta availability of his new book, "Mazes for Programmers", and invites the reader to participate in its completion by offering feedback, corrections, and suggestions — 2-minute read
  • ActiveAdmin simple_table

    Ruby-coloured glasses
    Taryn East
    22 Feb 2015 | 4:04 pm
    ActiveAdmin by default will build you a table (using table_for) for a collection of objects. But sometimes you just want to throw up a quick table of random values - eg on a dashboard you want a table where the left=column is a description and the right column is, say sets of counts of various things. ActiveAdmin uses Arbre under the covers to build html for you This means you can use it to laboriously build an html table using all the tags. But if you just want to throw together a super-simple table, this means too much typing. So I've written a convenience method that will take an array of…
  • Ruby Forwardable deep dive

    Saturn Flyer with Jim Gay
    19 Jan 2015 | 4:00 pm
    The Forwardable library is one of my favorite tools from Ruby’s standard library both for simplifying my own code and learning how to make simple libraries. I find that the best way to understand how code works is to first understand why it exists and how you use it. In a previous article I wrote about the value of using Forwardable. It takes code like this: def street address.street end def city address.city end def state address.state end And makes it as short as this: delegate [:street, :city, :state] => :address Shrinking our code without losing behavior is a great feature which…
 
  • add this feed to my.Alltop

    The Buckblog

  • Mazes for Programmers: Beta!

    Jamis
    3 Feb 2015 | 11:00 pm
    The author announces the beta availability of his new book, "Mazes for Programmers", and invites the reader to participate in its completion by offering feedback, corrections, and suggestions — 2-minute read
  • Lessons from the Kitchen

    Jamis
    29 Jan 2015 | 11:00 pm
    A retrospective on a personal journey, wherein the author's experiences of growing as a cook are compared with learning how to write software — 5-minute read
  • Hanging Out a Shingle

    Jamis
    25 Jan 2015 | 11:00 pm
    Our hero's plans change, and his journey takes an unexpected turn. — 1-minute read
  • Getting Back in the Pool

    Jamis
    19 Jan 2015 | 11:00 pm
    An announcement. Our hero indicates his availability for work, in the hopes that some team, somewhere, will make him an offer he cannot refuse — 2-minute read
  • A Better Recursive Division Algorithm

    Jamis
    14 Jan 2015 | 11:00 pm
    A novel variation on a the Recursive Division maze generation algorithm, in which regions are defined by arbitrary clusters of cells instead of rectangular divisions of the grid. The algorithm is presented and illustrated, and its benefits over the original algorithm are put forth. A demonstration in JavaScript is provided — 5-minute read
  • add this feed to my.Alltop

    Jay Fields' Thoughts

  • Experience Report: Weak Code Ownership

    Jay Fields
    23 Feb 2015 | 7:00 am
    In 2006 Martin Fowler wrote about Code Ownership. It's a quick read, I'd recommend checking it out if you've never seen it. At the time I was working at ThoughtWorks; I remember thinking "Clearly Strong makes no sense and I have no idea what scenario would make Weak reasonable". 8 years later, I find myself advocating for Weak Code Ownership within my team. Collective Code Ownership (CCO) served me well between 2005 and 2009. Given the make-up of the teams that I was a part of I found it to be the most effective way to deliver software. Around 2009 I joined a team that eventually grew to…
  • Preview Arbitrary HTML

    Jay Fields
    8 Jan 2015 | 7:23 am
    I'm a big fan of https://gist.github.com/ for sharing code. It's fantastic for quickly putting something online to talk over with someone else. I've often found myself wishing for something that allowed me to share rendered HTML in the same way. For example, a gist of the HTML for this blog entry can be seen here: https://gist.github.com/jaycfields/82e2cc0a588bd83a91f4. If I want someone to give me feedback on the rendered output, that gist isn't very helpful. It turns out, it's really easy to see that HTML rendered: switch the file extension to md. Here's the same gist with a md extension:…
  • LTR Org Chart

    Jay Fields
    7 Jan 2015 | 5:45 am
    Most traditional organizations have an Org Chart that looks similar to the following:Org Charts displayed in this way emphasize the chain of command. A quick look at a node in this Org Chart will let you know who someone reports to and who reports to them. The chart gives a clear indication of responsibility; it also gives an impression of "who's in charge" and how far away you are from the top.Several years ago I joined ThoughtWorks (TW). TW (at least, when I was there) boasted of their Flat Org Chart and it's advantages.A flat organization (also known as horizontal…
  • Making Remote Work: Tools

    Jay Fields
    6 Jan 2015 | 5:27 am
    I recently wrote about my experiences working on a remote team. Within that blog entry you can find a more verbose version of the following text:Communication is what I consider to be the hardest part of remote work. I haven't found an easy, general solution. A few teammates prefer video chat, others despise it. A few teammates like the wiki as a backlog, a few haven't ever edited the wiki. Some prefer strict usage of email/chat/phone for async-unimportant/async-important/sync-urgent, others tend to use one of those 3 for all communication.As you can tell, we have several different…
  • Making Remote Work

    Jay Fields
    28 Dec 2014 | 11:32 am
    Over 18 months ago I wrote Year Five, an experience report I never imagined I would write. I closed the blog entry by saying I look forward to writing about Year Six. A year and a half later, I'm still having a hard time deciding what (if anything) I should write. My writers block isn't the result the Remote Work experiment failing. Quite the opposite, the success of the Remote Work experiment has helped shape a team I'm very proud to be a part of, and yet I find myself unable to declare victory."How can you work effectively with remote teammates" has become the most common question I hear…
 
  • add this feed to my.Alltop

    Polishing Ruby + Software Releases - zenspider.com

  • minitest-sprint version 1.0.0 has been released!

    ryan davis
    3 Feb 2015 | 8:25 pm
    Runs (Get it? It’s fast!) your tests and makes it easier to rerun individual failures. Changes: 1.0.0 / 2015-01-23 1 major enhancement Birthday! home: https://github.com/seattlerb/minitest-sprint rdoc: http://docs.seattlerb.org/minitest-sprint
  • hoe version 3.13.1 has been released!

    ryan davis
    3 Feb 2015 | 4:00 pm
    Hoe is a rake/rubygems helper for project Rakefiles. It helps you manage, maintain, and release your project and includes a dynamic plug-in system allowing for easy extensibility. Hoe ships with plug-ins for all your usual project tasks including rdoc generation, testing, packaging, deployment, and announcement.. See class rdoc for help. Hint: ri Hoe or any of the plugins listed below. For extra goodness, see: http://docs.seattlerb.org/hoe/Hoe.pdf Changes: 3.13.1 / 2015-02-03 1 bug fix: Remove deprecated test_files from spec. (igas) home: http://www.zenspider.com/projects/hoe.html code:…
  • isolate version 3.3.1 has been released!

    ryan davis
    2 Feb 2015 | 3:58 pm
    Isolate is a very simple RubyGems sandbox. It provides a way to express and automatically install your project’s Gem dependencies. Changes: 3.3.1 / 2015-02-02 1 bug fix: Remove warning on redefined method on Gem::BasicSpecification. http://github.com/jbarnette/isolate
  • omnifocus version 2.2.0 has been released!

    ryan davis
    2 Feb 2015 | 3:14 pm
    Synchronizes bug tracking systems to omnifocus. Changes: 2.2.0 / 2015-02-02 1 minor enhancement: Customizable nerd folder via OF_FOLDER. (maxim) home: https://github.com/seattlerb/omnifocus rdoc: http://docs.seattlerb.org/omnifocus
  • minitest-excludes version 2.0.0 has been released!

    ryan davis
    2 Feb 2015 | 3:03 pm
    minitest/excludes.rb extends MiniTest::Unit::TestCase to provide a clean API for excluding certain tests you don’t want to run under certain conditions. Changes: 2.0.0 / 2015-02-02 1 major enhancement: Updated for minitest 5. home: https://github.com/seattlerb/minitest-excludes rdoc: http://docs.seattlerb.org/minitest-excludes
  • add this feed to my.Alltop

    Saturn Flyer with Jim Gay

  • The 4 Rules of East-oriented Code: Rule 1

    9 Feb 2015 | 4:00 pm
    4 simple rules are pretty easy to remember, but a bit harder to understand and apply. A key concept of East-oriented Code is to enforce the use of commands by returning the object receiving a message. Here’s a simple example of what that looks like: def do_something # logic for doing something omitted... self end It’s incredibly simple to follow. Here are the rules I set forth in my presentation at RubyConf: Always return self Objects may query themselves Factories are exempt Break the rules sparingly The first three are hard rules. The fourth, obviously, is more lenient.
  • Ruby Forwardable deep dive

    19 Jan 2015 | 4:00 pm
    The Forwardable library is one of my favorite tools from Ruby’s standard library both for simplifying my own code and learning how to make simple libraries. I find that the best way to understand how code works is to first understand why it exists and how you use it. In a previous article I wrote about the value of using Forwardable. It takes code like this: def street address.street end def city address.city end def state address.state end And makes it as short as this: delegate [:street, :city, :state] => :address Shrinking our code without losing behavior is a great feature which…
  • Avoiding clever mistakes when displaying data with missing values

    29 Dec 2014 | 4:00 pm
    In a previous article I showed a snippet of code I’ve used for displaying address information. There were some tricks to getting it right that are valuable to know when you have to handle missing data. Here’s the problem, and how to solve it. Let’s setup some simple data to use: street = "123 Main St." city = "Arlington" province = "VA" postal_code = "222222" The original implementation of displaying an address looked like this: "".tap do |string| string << street unless street.nil? string << city unless city.nil? string << province unless province.nil? string <<…
  • Enforcing encapsulation with East-oriented Code

    22 Dec 2014 | 4:00 pm
    Often our programs become complicated inadventently. We don’t intend to put things it the wrong place, it just seems to happen. Most of the time it happens to me when I allow my objects to leak information and eventually their responsibilities. In recent articles I showed code that handled displaying address details and how to separate the responsibility for formatting from the responsibility for data. But there’s still a problem which would allow me or someone else to unintentionally leak responsibility from these objects. It’s a good idea to be guarded against how much you…
  • Preferring value objects or setters and arguments

    15 Dec 2014 | 4:00 pm
    The problem with programming can be that there are so many ways to solve a problem. For each solution there are arguments for it and arguments against it. In recent articles I’ve written about moving responsibilities into a template object and out of the objects which use them for display. When the template code first began, its use was extremely simple: class Address def display(template) template.display_address(self) end end By making changes to the template to allow for shared behavior among different types of templates, the way in which our Address class used it became a bit more…
 
  • add this feed to my.Alltop

    Ruby-coloured glasses

  • ActiveAdmin simple_table

    Taryn East
    22 Feb 2015 | 4:04 pm
    ActiveAdmin by default will build you a table (using table_for) for a collection of objects. But sometimes you just want to throw up a quick table of random values - eg on a dashboard you want a table where the left=column is a description and the right column is, say sets of counts of various things. ActiveAdmin uses Arbre under the covers to build html for you This means you can use it to laboriously build an html table using all the tags. But if you just want to throw together a super-simple table, this means too much typing. So I've written a convenience method that will take an array of…
  • Link: run in with turbolinks

    Taryn East
    30 Nov 2014 | 12:24 am
    A quick link today to an article on turbolinks. It includes a couple of different levels of work-around snippets when adding javascripty functionality to your own links so it's pretty useful. Rails 4: My First Run-in with Turbolinks
  • Generate a subset of pseudo-random permutations in non mega-huge time

    Taryn East
    23 Nov 2014 | 6:38 pm
    One of the neat things about sending packages via sendle is that you don't have to print out a label or even know the address of your recipient (this is done so the recipient can keep their address private if they want). Instead, we give the sender a pair of unique code-names to put onto the package. So instead of J Random Shop-assistant at EvilCorp getting your full address, instead you write something like "From: Golden Lion To: Red Tiger". It's fun, as well as effective - like secret-agent names. but it does present us with an interesting problem - how do we generate unique codenames for…
  • Link: Fundamental Guidelines Of E-Commerce Checkout Design

    Taryn East
    19 Nov 2014 | 11:03 pm
    "Here is the harsh reality of e-commerce websites: according to recent e-commerce studies, at least 59.8% of potential customers abandon their shopping cart (MarketingSherpa puts it at 59.8%, SeeWhy at 83% and MarketLive at 62.14%). The main question is why do customers abandon their shopping cart so often?" Fundamental Guidelines Of E-Commerce Checkout Design condenses a large study into usability into 11 really useful guidelines to make your checkout experience much more likely to convert. Here's a condensed, tl;dr version: But I totally recommend reading the whole thing - it's not that…
  • Link: Advisory locks in postgres

    Taryn East
    13 Nov 2014 | 4:44 pm
    Advisory locks in postgres "PostgreSQL provides various lock modes to control concurrent access to data in tables. Advisory locks provide a convenient way to obtain a lock from PostgreSQL that is completely application enforced, and will not block writes to the table." This is not like row-locking your tables, this is to help you ensure concurrency for certain parts of your application. eg that you only enter a complex, resource-intensive part of your codebase once across all your servers. Given that ruby basically isn't very threadsafe - this provides a mechanism for concurrency-locking that…
  • add this feed to my.Alltop

    Ruby on Rails Blog

  • 5 Ways we keep our Communication Untangled

    Surekha James
    10 Feb 2015 | 7:00 am
    Ours is a time of technology, an era of non-verbal communication and the age of texting, tweeting, status updates and even, the now rudimentary email. Alright enough with the dramatics. But really, considering communication is almost completely not face-to-face nowadays, why does it bewilder us when we find that we have issues in communication? In software development and even more so, in agile development, communication is key. Whether it’s communication within the team or communication with the client, it is necessary to make sure that non-communication, or worse, miscommunication is…
  • Race Against Time

    Surekha James
    8 Feb 2015 | 9:02 pm
      Agile on a Deadline
  • Building an OCR using PDF.js and PDFText

    virendra
    22 Jan 2015 | 1:24 am
    A couple of years back I was handpicked (not really ) for a project that required me to work and build an application that would extract text from the PDFs uploaded into the system, using a bunch of baseline co-ordinates mapped against a sample pdf at start. The Project was named Invoice Analyser (IA) – since all the PDFs were actually invoices of our client. I still vividly remember the day when I was made aware of the requirement on call and soon after the call ended, I knew it was going to tough but I kept faith in myself. If I had to sum up the requirements, it would fit in 3…
  • Dealing with disillusionment in tech.

    siddharth
    12 Jan 2015 | 3:05 am
    As someone who has been in the tech industry for a while now, I’ve seen engineers getting disillusioned, overwhelmed and burnt out to a point where they couldn’t return to their original selves. Battling burnouts is still a subject that isn’t widely discussed in our field and a lot of those who’ve successfully survived it barely understand what they’ve been through. In an industry where we evangelize hackathons and sleeping under the desk, it’s hard to sustain as an individual that doesn’t associate failures in business or code as personal failures. This leads us to the general…
  • Face recognition in Ruby Using Kairos also Finding your celebrity-look-alike

    Shashank Singh
    19 Dec 2014 | 4:04 am
    Humans have an innate need to be identified with a group, that drives us to be an important part of something bigger than us. This implies a relationship that is greater than familiarity or acquaintances. “Facial structure” plays a big part in that identity, making online services like find-your-celebrity-look-alike a guaranteed success. Today, we are going to look under the figurative hood: How this technology works. We will be building a sample find-your-celebrity-look-alike application on Ruby using “Kairos”, a Third party face recognition api. With a simple example, we will…
Log in