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...
...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...
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...
When you simply want to get to know Puppet, follow puppetlabs’ Learning Puppet Docs. They give you a handy introduction inside a virtual machine they provide. You can watch the...
...cheatsheat and their learn-puppet virtual machine. #Installation and basic configuration on Ubuntu Linux: sudo apt-get install puppet, then follow this guide starting at "Creating a Puppet configuration"
Cucumber's docstrings let you add long strings to a step like this: # foo.feature Given this text: """ First line Second line Second Paragraph """ # foo_steps.rb Given /^this text:$/ |docstring| puts docstring.split...
# Does not work: Given this text: """ Docstrings work like this: \"\"\" Docstring example \"\"\" You see? """ Self-made Solution Cucumber Transforms to the rescue! Transforms are run on step arguments after...
There seems to be no way to use therubyracer -v '0.11.4' and libv8 -v '3.11.8.17' on OS X Mavericks. However, running bundle update therubyracer worked for me. It installed therubyracer...
...v '0.12.1' and libv8 -v '3.16.14.3' and I had not side effects. Log of my attempts to get it working Probably you got here when bundling failed building native extensions...
...Ruby. def and define_method differ in which one they use. def Ruby keyword, starts a method definition Opens a new, isolated scope. Variables defined outside are not accessible inside...
...and vice versa. Defines an instance method on the receiver (specified before the method name, e.g. def object.foo); implicit receiver is the default definee The default definee is not self...
...need to test some HTML, e.g. an embed code, you can use RubyMine's "scratch files": File > New Scratch File (or Ctrl + Shift + Alt + Ins) Select "HTML" as file type...
...or paste the HTML Move your mouse to the upper right corner of the scratch file editor. Pick a browser to instantly open your file...
For my Gem Session project Holly I ran the Ironman of drag'n...
...drop implementations: Dragging in nested lists User-definable order of items Complicated item elements with super-custom CSS and other Javascript functionality Items that can be both leaves and containers...
has_one :note end class Note < ActiveRecord::Base belongs_to :project end Now say we need a validation that ensures that a description is set (validates_presence_of :description...
...within Note but only if the Project has a flag called external set to true. The following code will lead to some problems as the associated object is not present...
When you have a complex recipe setup with multistage deployment you may run into this error: `role_list_from': unknown role `something' (ArgumentError) Consider this task definition: namespace :foo do...
...task :bar, :roles => :something do # do crazy stuff end end Whenever we call foo.bar in our recipe, Capistrano will fail if you deploy to a stage where none of the...
SimpleScreenRecorder I recommend simplescreenrecorder, it produces an adequate output with only a few clicks. The audio recording contained some static noises, but that might be caused by my microphone...
...can use the ffmpeg command line tool. In my case, I needed to cut the screen-cast by removing the sequence from 02:36 to 05:23. # Extract the parts...
If you're using Paperclip to store and convert images attached to your models, processing a lot of images will probably cause headache for your system operation colleagues because CPU...
If you're on Unix you can use nice to tell the Kernel scheduler to prefer other processes that request CPU cycles. Keep in mind that this will not...
...using form_for you can give the form's target URL either as a string or an array: form_for(admin_user_path(@user)) do...
# same as:
...path and polymorphic_url If you would like to generate a path or URL string from an array of route components just as form_for does, you can use polymorphic...
...restangular collection and you want to remove an element from it, after you've successfully deleted it from the server. The README suggests to say something like $scope.users = _.without($scope.users...
...horribly when you want to use restangular's attributes on that collection. This is simply because of the way _.without works: It returns a new array with all elements except...
...assignable_values does not invalidate a record even when an attribute value becomes unassignable. See this example about songs: class Song < ActiveRecord::Base belongs_to :artist belongs_to :record_label...
We'll create two record labels with one artist each and create a song for one artist. When we change the song's record label, its artist is still...
...with Xfce's sometimes arcane configuration UI, this can be a huge time waster and super-annoying if you need to get work done the same day. This card describes...
...how to setup a classic panel layout as you might be used to from Gnome 2 or Windows (see screenshot below). You can use this to quickly get productive in...
...a gem and you have a Gemfile in your project directory, you might be surprised that your gem dependencies aren't already required in your specs. Here is some info...
That also means that if you have an embedded Rails app in your spec folder (like has_defaults), and you boot its environment, it should call Bundler.require for you...
...modify (e.g. add 2px) a Sass variable that defines multiple values as one (e.g. for short-hand CSS definitions such ass padding), you can by using nth. It's ugly...
...While you could split up such variables into multiple values (e.g. combined padding into one for vertical and one for horizontal padding) in your own Sass definitions, when using some...
...a Pull Request on GitHub that includes commits from another Pull Request, you will still see them after the "child" PR has been merged. Unfortunately, GitHub won't automatically update...
Check out the target branch git checkout my-target-branch Make sure you are up to date against origin (e.g. git fetch and git status). You should...
...Its behavior differs from the default JSON.dump or to_json behavior in that it serializes Ruby symbols as ":symbol", and that it doesn't like an ActiveSupport::HasWithIndifferentAccess.
...want it to replace #to_json (but you can always just call Oj.dump explicitely). Security warning: Oj does not escape HTML entities in JSON Be aware that Oj.dump is not...
When you're writing specs for ActiveRecord models that use memoization, a simple #reload will not do: it 'updates on changes' do subject.seat_counts = [5] subject.seat_total.should == 5 # seat_total is...
...either memoized itself, or using some # private memoized method subject.seat_counts = [5, 1] subject.seat_total.reload.should == 6 # => Still 5 end You might be tempted to manually unmemoize any memoized internal method to...
Note that if you plan to downgrade Firefox because your Selenium tests broke after a Firefox upgrade, there is a better way that doesn't involve downgrading. Mozilla has stated...
...that they will no longer provide security patches for any but the most recent versions of Firefox. So running an old Firefox should not be a long-term solution for...
Sometimes, the IRB prints a warning during boot: irb: warn: can't alias source from irb_source. Explanation
...the IRB creates many aliases to give the user quick access to irb functions like source-ing a file. However, if IRB's context already responds to the alias it...