If you want a widget for awesome that runs a command regularly (every X seconds) and puts the output into your awesome panel, this is for you.

...below into your ~/.config/awesome/rc.lua. It supplies two methods: execute_command will run a command and return its output. Multiple lines will be joined into one line. The code is from...

Sometimes you can make your life easier by not allowing a record attribute to be changed after the record was created. An example for this is when your model represents...

...a child node in a composition and has logic that is hard to support for cases when the container changes. Here is an example for a container Region composed of...

...doing a git blame, git will blame the person who added or removed white space in a line (e.g. by indenting), not the person who originally wrote the code.

...git blame -w to ignore such white-space changes. You want this. \ Note that you can also use it when diffing: git diff -w. Example Consider this method, created by...

You want Spring for super-fast binstubs like bin/rails or bin/rspec which avoid Rails boot time. You want parallel_tests to speed up full test runs of large test suites...

...Unfortunately, you do not want parallel_tests to use your Spring binstubs as those parallelized tests will share data and/or loose some information. There are some issues about this on...

...default distribution from Ubuntu 14.04 (trusty) to 16.04 (precise). This might break your test setup for new builds. You can solve this issue by freezing your test distribution in the...

...travis.yml to Ubuntu 14.04 until you have the time to solve all the issues you will have in 16.04: dist: trusty Error details Here are few indicators that you ran...

makandra dev

...click', cssSelector, handler) Comparison Action jQuery DOM API equivalent Find descendant(s) by CSS selector .find(selector) one: .querySelector(selector), many: .querySelectorAll(selector) Test an element (returns boolean)

...matches(selector) Test for class presence (boolean) .hasClass(class) .classList.contains(class) Add class .addClass(class) .classList.add(class) Remove class .removeClass(class) .classList.remove(class) Toggle class .toggleClass(class) .classList.toggle(class)

...you can force absolute URLs throughout a response. Now you want to modify URLs similarly, but only in parts of a view (or controller) logic. Here is how.

...has only been tested on a Rails 2 application. It should work similarly for Rails 3. Put this into your ApplicationController: def rewrite_options(*args) options = super options.merge!(:only_path...

Active Record's select method allows you to make use of the power of MySQL select statements. On the one hand it allows you to select specific fields. Post.select("content...

...results in the following query: "SELECT content FROM `posts`" This means that your models will be initialized with only the content attribute and you will not be able to access...

...model inherits from others or uses many concerns / traits, it might be hard to see in the code which validators it has. But fortunately there's a method for that...

...UniquenessValidator:0x00007f55f1417e88 @attributes=[:name], @klass=UserGroup (call 'UserGroup.connection' to establish a connection), @options={:case_sensitive=>true, :scope=>:partner_id}>, #<ActiveModel::Validations::NumericalityValidator:0x00007f55f1415200 @attributes=[:user_count_limit], @options={:greater_than...

Unfortunately, Capybara does not offer a switch to disable cookies in your test browser. However, you can work around that by using a tiny Rack middleware -- it works for both...

...Selenium and non-Selenium tests. Wouldn't it be nice to say something like this? Given cookies are disabled When I try to sign in Then I should see "Can...

...UI's date picker and date time picker doesn't work on touch interfaces. Solution 1: Use Mobiscroll Another way is to detect touch devices and for those devices use...

...the Date and DateTime picker from Mobiscroll instead: if (isTouchDevice()) { $('.date_picker').scroller(); } else { $('.date_picker').datepicker(); } Mobiscroll uses a spinning wheel UI for picking dates and times, as known...

Since we are using LoDash instead of UnderscoreJS in recent/current projects, you should keep in mind that their syntax is a bit different. UnderscoreJS In UnderscoreJS, methods always return a...

...x).uniq() // => [1, 2] If you want to chain multiple calls, you need to start off with a _.chain, and call value() to terminate the chain. _.chain(x).uniq().map...

There are several gems that make it easy to read and process xlsx files. Parsing the entire file at once however is error-prone since each cell is transformed to...

...formatted but empty cells. As of today, I found two promising alternatives that provide a stream-based access to spradsheet rows: Roo supports multiple spreadsheet types like ODS or CSV...

Here is a symbol of an eight note: ♪ Its two-byte hex representation is 0x266A. This card describes how to create a string with this symbol in various languages.

Since our tool chain (editors, languages, databases, browsers) is UTF-8 aware (or at least doesn't mangle bytes), you can usually get away with just pasting the symbol...

makandra dev
vectormagic.com

Automatically convert bitmap images like JPEGs, GIFs and PNGs to the crisp, clean, scalable vector art of EPS, SVG, and PDF with the world's best auto-tracing software.

zeldman.com

...of things, and grownup professionals plan for it, just as they plan for budget shortfalls and extra rounds of revision...

github.com

...work cross-domain by tunneling all communications through an IFRAME on your page. Note sure if it's a wise idea, but it's a thing now...

makandra dev
github.com

jQuery plugin to fire events when user's cursor aims at particular dropdown menu items. For making responsive mega dropdowns...

developer.mozilla.org

...let you move back and forth through the user's history, as well as -- starting with HTML5 -- manipulate the contents of the history stack...

intridea.com

This article shows how to create a Sass mixin for a colored button. The button's foreground color is dynamically chosen between either black or white, depending on the given...

...background color. It's a nice intro into @if and @else conditionals in Sass...

github.com

...helpers for poking around at your Capybara driven browser's cookies in integration tests. Supports Capybara's bundled drivers (rack-test, Selenium Webdriver), and adapters for other drivers may be...

makandra dev
addyosmani.github.com

Twitter's Bootstrap CSS blueprint as a jQuery UI theme. Even if you don't want to use Bootstrap as...

...code from your repository. In order to do so, Capistrano connects to your repository server from the application server you're deploying to with SSH. For this connection you can...

...use two SSH keys: the user's ~/.ssh/id_rsa [default] the very same key you used for connecting to the application server - forwarded automatically to the git repository.

makandra dev

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"