Ruby

  • Most Topular Stories

  • Rails Active Record .median

    Ruby-coloured glasses
    Taryn East
    19 May 2015 | 5:17 pm
    Rails neatly provides an .average method to easily find the average value of a column on your db, but it doesn't provide one for finding the median. Thankfully it's really easily to implement If you just want to add it to one class, put this into the model: def self.median(column_name) median_index = (count / 2) # order by the given column and pluck out the value exactly halfway order(column_name).offset(median_index).limit(1).pluck(column_name)[0] end If you want it to work across all Active Record models in your db... you could add it as a concern (then include it in every class you want it…
  • Apache Spark Wrapper

    RubyFlow
    22 May 2015 | 5:06 am
    A gem which allows distributed computing in Ruby using Apache Spark.
  • Experimenting with L-Systems

    The Buckblog
    Jamis
    6 May 2015 | 11:00 pm
    An overview of L-system fractals, with a simple implementation in Ruby. An argument is given in favor of exploration, experimentation, and play. — 6-minute read
  • Be Your Own Angel – a revenue model for slow startups

    slash7 with Amy Hoy
    Amy Hoy
    8 May 2015 | 9:34 am
    Yes, recurring revenue grows sloooooowly. How do you, founder of a baby bootstrapping biz, survive the lean year or two before it can pay all your bills? Well, I have a strategy. I call it Be Your Own Angel. Last week, I gave a talk about it — in greater detail than ever before! — at PeersConf. And now I’m sharing it with you. Audio: Yep, my approach is pretty unconventional… but it works, really, really well. If you wanna learn what my students learn — which as helped them to the tune of ~$4 milion in revenue — then drop your name in the box below: How can you bootstrap on…
  • omnifocus-rt version 1.0.2 has been released!

    Polishing Ruby + Software Releases - zenspider.com
    ryan davis
    11 May 2015 | 4:35 pm
    Plugin for omnifocus gem to provide rt BTS synchronization. The first time this runs it creates a yaml file in your home directory for the rt url, username, password, default queue and query. The query is optional. If you don’t supply it omnifocus-rt will pull all tickets from the default queue assigned to the specified user. The use a custom query you must supply it in the config file. omnifocus-rt uses the REST interface to RT. More information about query formatting is available here: http://wiki.bestpractical.com/view/REST Example: :rt_url: rt :queue: QA :username: user :password:…
  • add this feed to my.Alltop

    RubyFlow

  • Apache Spark Wrapper

    22 May 2015 | 5:06 am
    A gem which allows distributed computing in Ruby using Apache Spark.
  • Porting ActiveRecord "soft delete" behavior to Postgres

    21 May 2015 | 4:50 pm
    You’ve probably used libraries like paranoia or acts_as_paranoid before. Check out how to implement this behavior in Postgres using functions, triggers, and views!
  • Build a Realtime Chat App with Ruby and Volt (screencast)

    21 May 2015 | 2:50 pm
    This week’s screencast takes a round trip through the Volt framework by building a realtime chat app in under 10 minutes.
  • Submit your Talk Proposal for Rubyconf Brasil!

    21 May 2015 | 12:25 pm
    This month we opened up the Call for Proposals website for the 8th edition of Rubyconf Brasil. We’ve been running this conference for 8 years in a row and it’s the largest Ruby conference in Latin America amassing around 1k attendees. Also, if your company is interested in reaching out to this large Ruby community, let us know. We will have a brand new conference format this year, read the description at the CFP site.
  • Tacokit.rb - a simple Ruby wrapper for the Trello API

    21 May 2015 | 7:54 am
    We use Trello to manage our development process and Ruby to extra data from Trello. Other Trello Ruby wrappers didn’t fit our needs. We wanted something simple, well-tested, and easy to use; we wanted ocktokit.rb for Trello. So we built tacokit.rb. Though still a work-in-progress, it’s now open source and we hope others will find it useful as well.
 
  • add this feed to my.Alltop

    The Buckblog

  • Experimenting with L-Systems

    Jamis
    6 May 2015 | 11:00 pm
    An overview of L-system fractals, with a simple implementation in Ruby. An argument is given in favor of exploration, experimentation, and play. — 6-minute read
  • Playing with Constants, Methods, and Superclasses

    Jamis
    23 Mar 2015 | 11:00 pm
    A few curious Rubyisms of dubious use, which may yet be worth knowing about — 3-minute read
  • Task Tracking for Neurochemical Brains

    Jamis
    16 Mar 2015 | 11:00 pm
    Presenting a simple (and perhaps very unoriginal) technique for keeping track of a list of tasks in the face of interruption and exploration — 4-minute read
  • 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
  • add this feed to my.Alltop

    slash7 with Amy Hoy

  • Be Your Own Angel – a revenue model for slow startups

    Amy Hoy
    8 May 2015 | 9:34 am
    Yes, recurring revenue grows sloooooowly. How do you, founder of a baby bootstrapping biz, survive the lean year or two before it can pay all your bills? Well, I have a strategy. I call it Be Your Own Angel. Last week, I gave a talk about it — in greater detail than ever before! — at PeersConf. And now I’m sharing it with you. Audio: Yep, my approach is pretty unconventional… but it works, really, really well. If you wanna learn what my students learn — which as helped them to the tune of ~$4 milion in revenue — then drop your name in the box below: How can you bootstrap on…
  • What does ’30×500′ even mean?

    Amy Hoy
    20 Mar 2015 | 5:30 am
    April, 2010. The party bus was rolling down the highway from Dublin to Kilkenny; it was upholstered in sparkly red and orange vinyl and full of my favorite kind of nerd, and I was perched on the stool in front with a mic clutched in my hand. I had just finished an impromptu little story about how I bankrolled Freckle’s slow SaaS growth by selling infoproducts (including the very first proto-30×500!). This was the first time I’d ever explained my Be Your Own Angel Investor approach in public. Paul Campbell (organizer) and Randall Thomas on a Funconf party bus, by adelcambre…
  • What I learned making a living on eBay

    Amy Hoy
    18 Mar 2015 | 4:22 pm
    Scene: A fancy tapas restaurant. Dark wood tables and candle lighting. Me and my business partner, Alex. As the ham croquettes arrive, I whip out my iPhone and tell Alex, “Just a sec, I need to bid on an auction.” He laughs at me. He calls me a crazy chair lady. I laugh too, because I win the auction. I now am the proud owner of 2 sleek turquoise egg chair reproductions. Later, when I sell off some other furniture, two separate dealers drool over them. “Where do you find all these things?” they ask. eBay, I say. I’ve furnished our house with truly awesome vintage…
  • “Nobody will pay $10,000 for an Apple Watch!” & other reasons you can’t sell shit

    Amy Hoy
    10 Mar 2015 | 9:40 am
    Are you going to spend $10,000 on the new Apple Watch Edition? No, right? Me either. Maybe you can’t afford it. Maybe you could drop $10k on a device but it seems repugnant or simply ridiculous. Maybe you don’t wear a watch at all; I sure don’t, and at this stage I don’t intend to start. Maybe everyone you know agrees: Overpriced. Who the hell would buy that? Nobody. Apple jumped the shark. You can’t upgrade the innards and jesus h, it’s gold, what a frigging waste, it’ll be obsolete in a year. Who the hell would buy a $10k watch with planned…
  • From “Oh, I shouldn’t charge money for this…” to a $20k launch

    Amy Hoy
    9 Mar 2015 | 9:25 am
    “The idea that, oh well, I shouldn’t charge money for this because… some reason. Justin Weiss spent years noodling on side projects. He made every excuse in the book for not charging for them, including some we haven’t often heard: At the time, it seemed like, ‘Why should I charge money for this? This is a passion project of mine.’ So I should just release it for free.” But last year, he decided to make a change. Justin took 30×500. In the first 3 weeks of droppin’ ebombs on his blog, he added his first 50 mailing list subscribers. (ebomb, n:…
 
  • add this feed to my.Alltop

    Polishing Ruby + Software Releases - zenspider.com

  • omnifocus-rt version 1.0.2 has been released!

    ryan davis
    11 May 2015 | 4:35 pm
    Plugin for omnifocus gem to provide rt BTS synchronization. The first time this runs it creates a yaml file in your home directory for the rt url, username, password, default queue and query. The query is optional. If you don’t supply it omnifocus-rt will pull all tickets from the default queue assigned to the specified user. The use a custom query you must supply it in the config file. omnifocus-rt uses the REST interface to RT. More information about query formatting is available here: http://wiki.bestpractical.com/view/REST Example: :rt_url: rt :queue: QA :username: user :password:…
  • osx_keychain version 1.0.1 has been released!

    ryan davis
    7 May 2015 | 5:40 pm
    Provides API and a command line tool to Access the OS X Keychain. The command line tool isn’t actually useful (use security instead), but demonstrates the usage quite well. Changes: 1.0.1 / 2015-05-07 2 bug fixes: Fixed tests to not bother if we’re not logged into OSX Removed dead rubyforge setting in Rakefile http://rubyforge.org/projects/seattlerb
  • omnifocus-bugzilla version 1.1.4 has been released!

    ryan davis
    7 May 2015 | 5:30 pm
    Plugin for omnifocus gem to provide bugzilla BTS synchronization. The first time this runs it creates a yaml file in your home directory for the bugzilla url, username, and queries. The queries config is optional. If it is not included bugzilla-omnifocus will pull all active bugs assigned to the specified user. To use a custom query or multiple queries you must include a queries parameter in your config. The queries config is an array of strings. Each string is the query string portion of the bugzilla search results url. Its easiest to create your search in bugzilla and then paste the portion…
  • flay-persistence version 1.0.1 has been released!

    ryan davis
    7 May 2015 | 4:56 pm
    Did you ever want to make your flay results persistent?!? Me neither, but now you can! This flay plugin allows you to run flay across multiple runs combining and persisting the results. This allows you to detect plagiarism or good gem candidates across multiple projects. Changes: 1.0.1 / 2015-05-07 1 bug fix: ZOMG I left in development code!?!? So embarrassed! (phiggins) home: https://github.com/seattlerb/flay-persistence rdoc: http://docs.seattlerb.org/flay-persistence
  • minitest-gcstats version 1.2.0 has been released!

    ryan davis
    6 May 2015 | 6:51 pm
    A minitest plugin that adds a report of the top tests by number of objects allocated. Changes: 1.2.0 / 2015-05-06 1 minor enhancement: Added assert_allocations to verify the number of objects allocated in tests. 1 bug fix: Fixed dependencies home: https://github.com/seattlerb/minitest-gcstats rdoc: http://docs.seattlerb.org/minitest-gcstats
  • add this feed to my.Alltop

    Saturn Flyer with Jim Gay

  • Cohesive behaviors with data clumps

    29 Apr 2015 | 5:00 pm
    A good example of how we use context and locality to understand and manage concepts in our code is using a data clump. A data clump is a collection of two or more bits of information that are consistently used together. You’ll find that your data loses its meaning when you remove items from the clump. Date ranges are simple examples of how a data clump puts necessary information into context. An example of this is to find out if a question was asked between today and one month ago. If our Question class implements a query method for this: class Question def asked_within?(start_date,…
  • The difference between instance_eval and instance_exec

    21 Apr 2015 | 5:00 pm
    There’s an important difference between instance_eval and instance_exec. And there’s a great lesson about how to use them well in FactoryGirl But first, before you go rushing off to build your fantastic DSL, let’s look at what instance_eval is and does. The simplest of examples can be taken straight from the Ruby docs: class KlassWithSecret def initialize @secret = 99 end end k = KlassWithSecret.new k.instance_eval { @secret } #=> 99 The current value for self inside the provided block will be the object on which you call instance_eval. So in this case the k object is the…
  • Locality and Cohesion

    20 Apr 2015 | 5:00 pm
    “The primary feature for easy maintenance is locality: Locality is that characteristic of source code that enables a programmer to understand that source by looking at only a small portion of it.” — Richard Gabriel This advice is from Patterns of Software by Richard Gabriel. Keeping cohesive parts of our system together can help us understand it. By managing locality we can keep cohesive parts together. It’s easy to see coupling in our code. When one object can’t do it’s job without another, we experience frustration in the face of change. We often think about…
  • The 4 Rules of East-oriented Code: Rule 4

    6 Apr 2015 | 5:00 pm
    Often the rules we create are defined by their exceptions. It is difficult to create a program which continually passes objects and never returns data. Often the first rule of “Always return self” is met with immediate rejection because it’s easy to see the difficulty you’d encounter if that rule is continually followed for every object. In my presentation for RubyConf, I showed how we break the rules to allow value objects to handle data for a template. I previously wrote about the approach I used in the presentation to push data into a value object. class Address def…
  • The 4 Rules of East-oriented Code: Rule 3

    16 Mar 2015 | 5:00 pm
    When I set out to create my presentation for RubyConf, I wanted to provide the audience with something they could easily try. By doing that, one could walk away and put themselves in a position to think about their code differently. While, James Ladd, the creator of East-oriented Code made some basic rules, I decide to take them and frame it in the specific context of Ruby: Always return self Objects may query themselves Factories are exempt Break the rules sparingly After writing about Rule 1 and Rule 2 I’m very eager to get to Rule 3. It’s an easy way to break the intent of this…
 
  • add this feed to my.Alltop

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

  • Multiple-Databases In Single Rails Application

    Manish Kangia
    28 Apr 2015 | 3:00 am
    This is a simple post to list some of the challenges faced during multiple database setup in a single rails application. The content in the post is available over the internet, we have consolidated it here to bring it at one place. While integrating multiple third party services we felt the need to store each and every pair of request-response shared between our application and others. We decided to use database tables to store this information instead of files or other options so to have an easy disintegration of data. This helped us in filtering for some particular handshakes based on…
  • Integrating Interswitch WebPay Payment Gateway With Rails

    Shubham Gupta
    30 Jan 2015 | 2:53 am
    Interswitch WebPay is a leading Nigerian payment gateway and integrating WebPAY with any website is fairly simple. At a high level this integration can be achieved with following steps: Calculate a request hash based on input parameters like transaction reference, amount, callback url etc. to ensure transaction integrity. Provide a URL at which WebPAY would post back the authorization response (callback url). POST these transaction details to WebPAY page Once the transaction is done, query the transaction details directly from WebPAY to ensure the actual transaction amount and the transaction…
  • Migrating from Protected Attributes to Strong Parameters

    Nishant Tuteja
    29 Jan 2015 | 1:30 am
    In Rails3, we use attr_accessible or attr_protected(Protected Attributes) to white-list attributes of a model for mass assignment. In Rails4, Protected Attributes was moved out as a Gem and similar feature was implemented at the controller level, which is now known as Strong Parameters. We were migrating one of our project from Rails3 to Rails4 and decided to use Rails’ Strong Parameter instead of using the Protected Attributes Gem. While migrating from Protected Attributes to Strong Parameters we found ourself in a situation where we were repeating the same code. To elaborate, in…
  • EmberJS: Snagged by belongsTo association

    Chirag Mongia
    12 Jan 2015 | 3:00 am
    Writing Javascript code using MVC framework and rendering templates at client side is the new fancy way of writing web applications. As they say, when Rails is the backend, Emberjs at frontend is a good fit. The beauty of the architecture along with our excitement has impelled us to dive into this framework. It started with revamping of an eCommerce site by building its version-2 using Emberjs as frontend framework and Rails as an api server. Initially, everything was working fine and we were enjoying our Emberjs learning and implementation, but in the following scenario belongsTo association…
  • Custom Edit Control for UITableViewCell

    Satish
    6 Jan 2015 | 7:02 am
    In one of my recent iOS project I was supposed to replace table view cell default edit control with a custom button to match the designs. I guess everyone knows that its pretty simple to change edit control’s color for selected state, we simply need to set cell’s tint color. But there is no way to customise selected or default state of cell edit control with our own custom image because there is no public API to access this control. So, to customise this we have to write our own code. Steps below will guide you to achieve this. Step 1: Hide Default Edit Control First of all add…
  • add this feed to my.Alltop

    Ruby-coloured glasses

  • Rails Active Record .median

    Taryn East
    19 May 2015 | 5:17 pm
    Rails neatly provides an .average method to easily find the average value of a column on your db, but it doesn't provide one for finding the median. Thankfully it's really easily to implement If you just want to add it to one class, put this into the model: def self.median(column_name) median_index = (count / 2) # order by the given column and pluck out the value exactly halfway order(column_name).offset(median_index).limit(1).pluck(column_name)[0] end If you want it to work across all Active Record models in your db... you could add it as a concern (then include it in every class you want it…
  • Link: Flaws In Scrum And Agile

    Taryn East
    8 Mar 2015 | 5:57 pm
    In The flaws in Scrum and Agile Giles Bowkett explains why Panda Strike feels that Agile is basically a past-technology. Good in it's day, with some useful lessons we can keep, but largely not relevant to the way that distributed teams work these days. It's a very interesting read, and I find myself agreeing with it.
  • 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…
Log in