Double Shot #823
Today I ship my last Windows server off to a good home.
- Amazon Simple Workflow - Workflow management in the cloud, of course tied in to all the other Amazon web services.
- atea - Open source menu bar time tracker for OS X that maintains state in text files.
- Curator - Model/repository framework from Braintree that separates persistence from domain logic. At the moment your choice for persistence is Riak, but that should expand if it catches on. See the announcement blog post for more info.
- Nezumi - Remote management for Heroku apps on iOS or Android.
- Maqetta - Browser-based IDE for HTML5 user interfaces.
- I Told You it Was Private - Actively punish code that calls your private interfaces.
- RABL - General purpose templating system for APIs, that can generate JSON, XML, MessagePack, PList, or BSON files.
Using CarrierWave and S3 with Mercury Editor
I've been using Mercury Editor in a new project to get editable text directly in the browser. By default, it stores images locally, but we wanted to put them on Amazon S3 instead. Here's what that took using CarrierWave:
Add a model to hold the images
class BlogImage < ActiveRecord::Base
mount_uploader :image, ImageUploader
end
Not much to see here, just a single string attribute to hold the image info.
Add an uploader
require 'carrierwave/processing/mime_types'
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
include CarrierWave::MimeTypes
process :set_content_type
storage :fog
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
end
Obviously you could process extra versions or limit extensions here, but all Mercury needs is someplace to dump what it takes in.
Replace the Mercury Images Controller
To hook everything up, you just need to replace the images controller in the engine with app/controllers/mercury/images_controller.rb in your project:
class Mercury::ImagesController < MercuryController
respond_to :json
def create
@blog_image = BlogImage.new(params[:image])
@blog_image.save!
render :json => @blog_image.to_json(:only => :image)
end
def destroy
@image = BlogImage.find(params[:id])
@image.destroy
respond_with @image
end
end
Double Shot #822
It remains The Year Without Winter here, and I can't say I object.
- mocktra - Mock your web sites using Sinatra.
- Control Your Development Environment And Never Burn Another Hamburger - Noel Rappin pleads for more effective tool use by developers.
- Announcing: Unwind Gem - Start with a short redirected URL, end with the real URL - that is, figure out what the original really points to.
- Announcing the jquery-ui-rails Gem: jQuery UI for the Asset Pipeline - And where was this two months ago when I needed it? Looks much simpler than doing things by hand.
- VersionSwitcher - Like rvm, but for multiple programming languages.
- Advanced Caching in Rails - Good writeup from Adam Hawkins.
- Using CSS without HTML - Yes, it turns out you can write a web page with completely empty 'view source.'
What's New in Edge Rails #9
Week of February 12-February 18, 2012
Things are still moving along in the usual Rails fashion of incremental improvement.
- There was a bunch of work on the internals of inflections, including d3071db1 which, if I'm reading it right, is a serious bit of optimization.
-
d6b26a6 adds
date_field
anddate_field_tag
helpers to create HTML5 date inputs. - 951b5820 makes it easy to run a class other that IRB as your Rails console - a boon for Pry users.
Double Shot #821
Some links from the part of the weekend that I didn't spend out in the woods.
- Coffee Taster: An Easy CoffeeScript Development Environment for Ruby Developers - Run a rake task, open a file in the browser, edit.
- Sidekiq::Mailer - Send mail in the background using Sidekiq.
- Codo - YARD-like documentation generator for CoffeeScript.
- Gitbox - Git GUI client that looks like Mail; an interesting rethinking of a SCM user interface.
- Weave - Interesting looking open source visualization platform oriented around displaying geographic datasets.
- Ruby Doc App and Rails Doc App - A pair of free iPhone/iPad apps to keep handy while you code.
- Debugging JavaScript - Early peek at the next round of js debugging features in Firefox.
- Today's sysadmin todo list - All too true.
- The Julia Language - New "high-level, high-performance dynamic programming language for technical computing." I'm waiting for Julia on Jalopies myself.
- FrontendServer - Simple server for developing JavaScript front-ends, set up for both local use and deployment to Heroku.
- Lazy Routing Helper Generation for Named Routes - Defers generation of routing helpers under Rails 3 until they're actually used.
- How key-based cache expiration works - Worth reading if you're not familiar with Rails' caching strategy. Comments also have some interesting caveats and links.
Double Shot #820
- XCode, GCC, and Homebrew - One of the good things about Mountain Lion: Apple shipping official tools to support homebrew (and you can download them today).
- capybara-firebug - Run Capybara tests with Firebug enabled under the selenium driver.
- Youporn.com is now a 100% redis site - Another triumph for the technology of porn.
- Ruby 1.9.3-p125 is released - Yay for new releases.
- I Wouldn't Learn Ember in 2012 - Trolling or troll-stomping? You decide.
- Google Circumvents Safari Privacy Protections - This is Why We Need Do Not Track - Too bad we don't have some big player on the web scene dedicated to not doing evil.
Double Shot #819
Isn't it Friday yet?
- Style Master - $60 commercial tool for WYSIWYG CSS development.
- Leaflet - Open source JavaScript library for interactive maps.
- Capistrano task - show deployed revisions & diffs - Not exactly what I needed, but pretty darned close.
- JotForm.com Suspended - The US government's war on user-generated content continues. I'm wondering how long it'll be before DropBox, Evernote, and everything else gets shut down.
- RubyMine 4 is Here to Make You Feel the Productivity - New release of JetBrains' IDE for Rails.
- ror_ecommerce 1.0 - Project that's meant to be a starting point for Rails e-commerce applications.
- high performance rails caching with redis and nginx - Delivering the cached info without hitting the Rails stack at all.
- MySQL Cluster 7.2 GA Released, Delivers 1 BILLION Queries per Minute - Too bad it's an Oracle product now.
Double Shot #818
Time to get on with the day.
- Mixu's Node Book - An introduction to Node.js, with a few advanced topics.
- Enumeradical - Extensions to enumerable to make working with collections of objects a bit nicer.
- Rails is Definitely Not for Beginners - And yet many of us were beginners once.
- Linting the hell out of your Ruby classes with Pelusa - New static analysis tool for ruby code.
- Viewpoint for Sharepoint Web Services - I'm sure someone needs this ruby wrapper for Sharepoint. I'm glad it's not me.
- Client-Side MVC frameworks compared - There sure are a pile of them now.
- The Pry Ecosystem - I really do need to spend the time to learn to use pry as a debugging tool. As soon as all these bugs are fixed.
Double Shot #817
Snow on the ground for the first time this winter. Doesn't look like it'll last long though.
- Cane: failing your build for code quality problems - A quality checking tool for Ruby 1.9.
- Octokit - Version 1.0.0 of this Ruby wrapper for the GitHub V3 API is out.
- Every Little Things Capistrano Does Is Magic - A peek at some of what goes on when you type 'cap deploy.'
- BusyFlow - Integrate Pivotal Tracker, Dropbox, Google Docs, GitHub, and some other cloud-based bits.
- Git 1.7.9 Release Notes - Now supporting GPG signed commits, among other things.
- Firefox 2012 Strategy & Roadmap - Lots of goodies planned to come this year.
- resque-waiting-room - Simple throttling for resque jobs.
- Sample App with Backbone.js and Twitter Bootstrap - I'm not all the enamored of single-page apps myself, but that might just be a sign of advancing age.
What's New in Edge Rails #8
Week of February 5-February 11, 2012
Some goodies for PostgreSQL users this week, as well as other odds and ends.
- As of d70e0236 Active Record supports PostgreSQL partial indexes.
add_index(:accounts, :code, :where => "active")
generatesCREATE INDEX index_accounts_on_code ON accounts(code) WHERE active
. - f7b915b5 adds support for PostgreSQL hstore columns.
- Working with CoffeeScript gets just a tiny bit nicer now that
rake notes
picks up annotations from.coffee
files in dd8c6f05. - I'm not convinced of its utility, but 60dad828 allows you to provide
Float::INFINITY
as an argument tovalidates_length_of
. - A batch of commits replaced use of
ActiveSupport::OrderedHash
with pure Ruby 1.9 hashes.
Double Shot #816
Flotsam and jetsam from my weekend.
- Monitoring your Continuous Integration Server with Traffic Lights and an Arduino - This is the sort of thing that geeks do when they're trying to avoid actual work.
- How to use bundler with multiple Gemfiles in plugins/extensions - I thought I might need to do this last week. I still might, so tucking the link away.
- How We're Hacking Email at HubSpot - Some tips for people who want to ensure their emails get delivered and read.
- About This Week's Availability - Kudos to GitHub for complete transparency. And I'd like to meet the morons who are DDOSing them in a dark alley with a baseball bat.
- red, green, refactor - the tools for success - Lots of links to useful-looking test-fu here.
- simplecov - Supremely easy test coverage tool for Ruby 1.9.
- rack-bouncer - Middleware to send unwanted browsers elsewhere.
- Getting Started with iOS Development using Sinatra on Heroku/Cedar - Native iOS application that consumes a web API, that is.
- asset_sync - Hook into the Rails asset pipeline to synchronize assets to an AWS S3 bucket.
- Prickle - DSL to extend capybara with even more syntactic sugar. Useful for those who don't remember xpath off the top of their head.
- standalone-migrations - Use Rails migrations in non-Rails projects.
- Autoenv - Sort of like an .rvmrc file for shell variables. If a directory contains a .env file, it'll automatically be executed when you cd into it. (Hat tip: Wynn Netherland)
- kickoff - HTML5 template for Sinatra applications.
- Spree 1.0.0 Released - A major milestone in ecommerce for Rails.
- Firefox's New Tab Page lands on Nightly and Aurora channels - A bit of eye candy that I've been enjoying in edge Firefox.
- Code Climate - Commercial service to monitor your source code for quality, hotspots, metrics and so on.
Open Source Report #5
Looking for a way to get involved with open source? How about the Ruby Documentation Project? They've got a list of areas in Ruby that need help and a step-by-step guide for helping out. And how cool would it be to have your work committed to core Ruby?
As for myself, it's been a slow week, but I've been moving along:
- RubyGems Guides - Most of my open source work over the past week went here. I've now finished an editing pass over the whole thing, and added new material to the credits, resources, and FAQ pages. Next up: porting over what's still worth preserving from the old RubyGems Manuals site. Details are in the repo.
- Tabulous - I had to put together a patch to make this tabbed navigation library play well with Bootstrap 2.0 for a client. As it happens the lead developer worked up his own patch at the same time, so I won't be submitting mine upstream.
- axlsx - I've been needing this Office Open XML generator in a Rails 3.0 project, which required meddling with the gemspec. It seems to be working fine, so I'll be sending that tiny change back upstream.
- And of course there was the new What's New in Edge Rails.
Double Shot #815
A quiet end for the week.
- CALL FOR ACTION: THE OPEN WEB NEEDS YOU *NOW* - I'm fairly sure the open web is doomed, but it's probably worth fighting the rear-guard action anyhow.
- Getting Gmail to handle all mailto: links with registerProtocolHandler - A tip for Chrome and Firefox.
- Heroku Toolbelt - The bits you need to get started developing applications for deployment on Heroku.
- pull - Create GitHub pull requests from the command line.
Double Shot #814
- micro-cutter - Generator for microgems.
- plymouth - Automatically start a pry session when a test fails, putting you right into the failing context.
- New Virtus Release With Truly Awesome Features - Attribute support for plain old ruby objects.
- Introducing Git Submodules in Tower - Having a git GUI that supports submodules might actually make them usable.
- The RedMonk Programming Language Rankings: February 2012 - Another look at the perennial question of where the new hotness lies.
- stasis - Gem to compile templated ruby sites to static HTML plus assets.
Double Shot #813
The New York Times has discovered multiple monitors. I'm amused.
- Airbrake acquired by Exceptional - Some consolidation in the Rails error-tracking world. More information on the history leading up to this here.
- DynamoDB for the Uninitiated - A simple spike in Ruby.
- Continuous Deployment with Capistrano and Jenkins - Pretty easy to wire up as it turns out.
- Ruby Trick Shots - Video promo for a new ebook that Peter Cooper is putting together.
- Travis needs your help - Fundraising site for the CI system that's being used by Rails, Rubinius, RubyGems and other prominent projects.
- Browsernizer - Rack middleware to handle "please upgrade your browser" requirements.
- Ruboto: Ruby's and Android's First Born - A walkthrough of getting ruby code on to your Android device.
- Using the Battery API - Part of WebAPI - Yes, modern web sites can check whether your battery is charging.
- Falsehoods Programmers Believe About Names - Dealing with people's names is a surprisingly deep problem.
- Factsheet Five Collection, ca. 1982-1992 - Nothing to do with programming. Just a glimpse of one of my past lives.
Double Shot #812
Winter appears to finally be visiting for a few days.
- Modernizr 2.5: Supercharged for 2012 - Lots of changes in this tool that helps figure out the capabilities of your users' browsers - and work around missing features.
- Amazon S3 Price Reduction - Lower prices are always nice. Wonder how long before someone files a restraint of trade lawsuit against Amazon though.
- If you're using Node.js, you're doing life wrong - A moderately entertaining rant.
- The tools we use (and love) at New Relic - A list without commentary, but it's interesting to see what one successful team builds on.
- sidekiq - Message processing replacement for resque that claims to make more efficient use of resources. More info on the basic approach here.
- New in Pivotal Tracker: Improved Stories! - I'm not yet convinced that this fresh coat of paint is an improvement, but waiting to see how it plays out in practice. Of course, I didn't like gray-on-gray in my OS either.
- Command Line Reporter 3.0 Released - Now with colorized and boldface output for your command line jobs.
- Differences Between jQuery .bind() vs .live() vs .delegate() vs .on() - A consistent API is the hobgoblin of little minds.
- Apple's great GPL purge - Blah. With Apple apparently losing interest in open source, it may be time to move on again.
What's New in Edge Rails #7
Week of January 29-February 4, 2012
Things are still moving along on the Rails 4 front, with a mix of tidying up and new features. Here are some of the commits that caught my eye last week.
- A whole mess of commits worked over some of the collection form helpers. Now
collection_select
andoptions_from_collection_for_select
can take procs to evaluate their text and value in the current context, and there are newcollection_check_boxes
andcollection_radio_buttons
helpers. The easiest starting point is with f506c806 which documents the API changes. - 8270e4a8 implements the null object pattern for Active Record relations. Post.none will return a relation containing no posts - which may seem daffy, but makes for much nicer chainable methods on your Active Record objects.
-
b31eac56 replaces all
for
loops in the Rails source code withEnumerable#each
. This should lead to considerably less confusion for new Rails developers. -
336ff8a9 reworks the
:dependent => :restrict
construct for Active Record associations to deprecate raising an exception on violation. - 66c04431 updates Rails' Unicode support from 6.0 to 6.1, making it pile of poo compatible.
Double Shot #811
Not so much to report this morning, since I spent a good chunk of the weekend out with the Boy Scouts.
- Twitter's Bootstrap in the Asset Pipeline - Hooking it up using the less-rails-bootstrap gem.
- Async JavaScript - Book project on Kickstarter.
- Try Redis - An in-browser demonstration and tutorial.
- HTML5: Browser Caching - the latest from PeepCode.
- riak-ruby-client - This gem has hit version 1.0, for those of you interested in riak.
- Introducing Falcore and Timber - A pipelined web server (written in Go) and a logger library to go with it.
- Heroku and Rails 3.2 asset:precompile error - And how to fix it.
- turn.js - Page-turning animation for your HTML5 sites.
- QuoJS - "Micro JavaScript Library for Mobile Devices."
Open Source Report #4
In the spirit of keeping myself honest, here's what I've touched on open source work over the past week. Most of it isn't spectacular, but I did manage to do something every day in January and I'm happy about that.
- RubyGems Guides - This was where I did most of my work the past week, bringing in a new Contributing page and taking editing passes over a few other pages. Details are in the repo.
- RubyGems - Deprecated the separate contribute repo and retargeted the Contribute link on the RubyGems.org home page to point to the Guides Contributing page instead. Show me the cookies - Updated the documentation for this Capybara addon.
- What's New in Edge Rails -Finished up #6 in this series.
Double Shot #810
A few orts to close out the work week.
- Jason - Free JSON viewer and editor for OS X.
- The History of Rubinius - Evan Phoenix offers some insights into the origin and growth of Rubinius.
- Ruby Freelancers - New site featuring a podcast for those interested in getting started.
- Yes, You Should Write Controller Tests! - Argues that as classes, they need test coverage in every method. I find that recently I've been writing a lot more integrations than functionals to achieve that, though.
- Shef Tips and Tricks: Steppiong Through Chef-client Runs with Shef - An introduction to the interactive console for the Chef automated provisioning system.
- Backbone.js: A Roundup for Beginners - Start here with a bunch of links to other resources.
- Customising ActiveRecord's attribute formatting on inspect - Yes, it can be done. And it's useful.
- Unicode Character 'PILE OF POO' (U+1F4A9) - Yes, it's really part of the standard.
- The Ultimate Collection of Emacs Resources - Yep, you have fun with that.
- StratifiedJS - Another approach to concurrency programming in JavaScript.
subscribe via RSS