m.onkey.org

decided to go fixtureless with Shoulda + Factory Girl. All good, except one problem. Slow as fuck tests. So here’s fast_context as a solution for it. fast_context compiles...

...all the ‘should’s within a context into a single test...

css-tricks.com

...the ‘border’ of any block level element gets factored into it’s final box size for layout. That means that if you add a border on a hover to an...

...element that didn’t already have a border of that exact size, you will cause a layout shift...

documentcloud.github.com

...a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built...

staringispolite.com

...time programming languages understood what the kids are typing these days. So let's start with a baby step in that direction: Like, Python...

daringfireball.net

...Apple does not want is for some other company to establish a de facto standard software platform on top of Cocoa Touch. Not Adobe’s Flash. Not .NET (through MonoTouch...

javascriptweblog.wordpress.com

Inspired by a snippet of code in Oliver Steele’s legendary Functional library, here’s a lightweight tool to help keep track of JavaScript invocations. It works in Chrome, Safari...

hagenburger.net

Lemonade’s goal as a sprite generator is to be incredible easy to use, so you’ll use ist for every project—just because there’s no overhead. It needs...

...no configuration, no Rake task, no Photoshop, just a little change in your Sass or SCSS files...

alistapart.com

...remember that the pain is temporary. It’s a little like a vaccine—the shot hurts now, true, but it’s really not that bad in comparison to the disease...

teddziuba.com

The problem isn't that Git is to hard, it's that smart developers are impatient and have exactly zero tolerance for unexpected behavior in their tools. While Git is...

...now, perhaps some day you will come across a grizzled developer who is using SVN, and when you ask him why, his answer won't make sense, because it's...

...for example through an Ubuntu release upgrade) you might notice that Thunderbird will not show any of your old e-mails or settings. This results from a different directory being...

...used for storing profiles and configuration. You can replace the blank profile with your old one like this: cd ~ mv .thunderbird .thunderbird-invalid cp -R .mozilla-thunderbird .thunderbird

...convinced that an error must be very close to the network card, OS IP stack or compiler. In reality this is quite rare, so before continuing, triple-check that the...

...issue is not located between chair and keyboard... If you're still convinced that a in-depth analysis of network traffic might help you, go on: Find out the IP...

ubuntuforums.org

...I found the same problem, but only on my wife's account. I'd set her keyboard layout to UK through Gnome preferences and every time the US layout would...

...reappear and be selected frustratingly.\ It turned out that on the gdm login screen her choice of keyboard layout in the discreet option bar at the bottom of the screen...

teddziuba.com

Around the time in my life when I stopped ordering drinks made with more than one ingredient, I was woken up for the last time by a hypochondriac Nagios monitoring...

...If you are on-call long enough, you cultivate a violent reaction to the sound of your cell phone's text message alert. If your monitoring is overconfigured, that reaction...

makandra dev

rspec_spinner is a progress bar for RSpec which outputs failing examples as they happen (instead of all at the end). Installation gem install rspec_spinner Usage script/spec -r rspec...

...spinner -f RspecSpinner::Bar -c To make a shortcut in your .bashrc alias ss='script/spec -r rspec_spinner -f RspecSpinner::Bar -c' There's also an alternate runner RSpecSpinner::Spinner...

makandra dev

Ubuntu lets you mount an SSH shell into Nautilus from Places -> Connect to server (select "SSH" as server type). In order to copy a file over SSH from a shell...

...scp filename username@remotehost: The trailing ":" directs the file to username's home directory on the remote host. You can also copy a file from the remote host to your...

makandra dev

...the data to /tmp/geodb_coodinates.csv. And it's fast: Query OK, 337925 rows affected (0.86 sec) SELECT * INTO OUTFILE '/tmp/geodb_coordinates.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n...

sudo apt-get install i8kutils Reboot You can now run the i8k tools such as i8kmon Setting the fan speed to high (2) will only work shortly as the fan...

...is somehow controlled automatically.\ This helps you out in bash: while true; do i8kfan - 2; sleep 0.2; done There should be a better solution and it will be posted as...

opensoul.org

...so ETags are only saving you render time and some bandwidth. While working on a Sinatra-based JSON web service that gets very heavy traffic, I wanted to find a...

...way to short-circuit requests and avoid most of the stack if a resource hasn’t been modified...

If you need to call a state_machine event and do not want to re-define resource_controller's create method, try this: create.before do object.state_event = :launch_spaceship

You may omit the /path/to/link_name to have a link with the same filename appear in the current directory

It's that simple to allow one of your Linux users to run a single command as UID 0: sudo visudo Add the line below to allow user 'deploy' to...

blog.plataformatec.com.br

...that you want to provide default views for a group of controllers. Let’s say you have a bunch of controllers inside the Admin namespace and you would like each...

...action for Admin::PostsController and “app/views/admin/posts/index.html.*” is not available, it should then render “app/views/admin/defaults/index.html”. Since Rails 3.0, we have a new abstraction called resolvers that holds the logic to find...

yehudakatz.com

...is that the purpose of refinements in Ruby 2.0 is to make monkey-patching safer. Specifically, the goal is to make it possible to extend core classes, but to limit...

...the effect of those extensions to a particular area of code. Since the purpose of this feature is make monkey-patching safer, let’s take a look at a dangerous...

jashkenas.github.com

Imagine all the syntactical delights of Ruby and Haml for your JavaScript. You write in a nice language, but get normal JavaScript at runtime. All whilst having full access to...

...3rd-party JavaScript libraries (jQuery, PrototypeJS), debugging support (it becomes pure, readable JavaScript), existing support from test suites (it’s normal JavaScript) and growing support from various text editors (TextMate...