- Search for repeating cards with
- Search for unfinished cards with
- Search for cards in a certain topic with
- Search for phrases with
- Exclude a word from search:
- Exclude a phrase from search:
- Exclude a topic from search:
You want Photoshop to always open files with “full” (100%) zoom and not try to fit them to your screen?
Tough luck – there is no setting for this.
But, after opening the file, you can zoom to 100% by:
0(on Windows; for Mac it’s
- or double-clicking the magnifier tool icon.
Gem to get Rails 3’s new ActiveRecord query interface (
order) and the new scope syntax (chaining scope definitions) in Rails 2.
You also get
#to_sql for scopes.
Sometimes you want one distinct version of RubyGems to be installed to replicate the same behavior across multiple servers.
Usually would do this to update your RubyGems, but this always takes you to the latest version:
sudo gem update --system
While there are ways around the interwebs that use the
rubygems-update package and call its
setup.rb, there is an undocumented switch you can use:
sudo gem update --system 1.3.7
This updates to the given version, 1.3.7 in the above case, by walking the
rubygems-update package way it…
Let’s say you have commits that change a file (and looking at the commit details show you the changes, etc). Now, when you do a
git log you see them, but when you say
git log that.file these commits don’t show up? This is for you.
The reason is that the file got deleted deleted/re-added/renamed (any or all of those).
Instead of …
git log master -- some.file
… you need to say:
git log --follow master -- some.file
Then your commits will show up.
tig also understands
Kudos to Julien…
In cucumber you are able to run features in whatever directory you like. This also includes executing features in subdirectories. There are only some things you have to take care of.
By default, cucumber loads all
*.rb files it can find (recursively) within the directory you passed as argument to cucumber.
$ cucumber # defaults to directory "features" $ cucumber features $ cucumber my/custom/features/dir
So, if you would like to organize features in subdirectories, you won’t have *any problems when running the whole test…
The following snippet demonstrates how you could create excel files (with spreadsheet gem) and format columns so that they follow a specific number format like currencies or dates do.
require 'rubygems' require 'spreadsheet' Spreadsheet.client_encoding = 'UTF-8' book = Spreadsheet::Workbook.new sheet1 = book.create_worksheet :name => 'test' money_format = Spreadsheet::Format.new :number_format => "#,##0.00 [$€-407]" date_format = Spreadsheet::Format.new :num...
Look up HTML5 features, know if they are ready for use, and if so find out you should use them – with polyfills, fallbacks or as they are.
Gem to get Ruby 1.9 features in Ruby 1.8.
Twitter’s Bootstrap CSS blueprint as a jQuery UI theme. Even if you don’t want to use Bootstrap as a CSS framework, this theme looks better than jQuery UI’s default theme.
A short tutorial for XPath. It’s the first XPath introduction that ever stuck with me.
I have no idea how it’s supposed to work (or why the don’t have a print CSS), but this works for pages written with Markdown:
- “Edit” the wiki page
- Copy all text
- Run a Markdown interpreter and pipe its result, e.g.:
kramdown > /tmp/github.html
- Paste your markdown
- Press Ctrl-D to finalize your input
- Open the generated HTML file and print it.
This describes all the steps you’ll need to get Solr up and running for your project using the Sunspot gem.
Prepare Sunspot on your development machine
What you want in your Gemfile:
gem 'sunspot_rails' gem 'sunspot_solr' gem 'progress_bar' # for sunspot:solr:reindex
Now define what should be indexed within Solr from your ActiveRecord models, e.g.,
class Article << ActiveRecord::Base searchable do text :title ...
Views are normally (for good reason) not rendered in controller specs. If you need it to happen, use:
Note that you can’t use that inside
it blocks but need to put it in the nesting example group, like this:
describe '#update' do context 'when ren...
Code coverage for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites.
Note that rcov won’t ever have support for Ruby 1.9, you’re supposed to use rcov for 1.8 and simplecov for 1.9.
Use the command
geordi migrate-all to migrate your databases and to prepare them before running tests. The abbrevation
geordi m works as well.
- It will run
power-rake db:migrateif parallel_tests does not exist in your Gemfile
- Otherwise it runs
b rake db:migrateand then executes
b rake parallel:prepareif parallel_tests was found in your Gemfile.
Removing features and merging those changes back can be painful. Here is how it worked for me.\ tl;dr: Before merging back: reinstate reverted features in a temporary branch, then merge that branch.
Consider your team has been working on several features in a branch, made many changes over time and thus several commits for each feature.\
Now your client wants you to deploy while there are still stories that were rejected previously and can’t be deployed. …
Firefox, Opera and Internet Explorer will repeat elements with
position: fixed on every printed page (see attached example).
The internet knows no way to do this in Webkit browsers (Chrome, Safari). These browsers will only render the element on the first printed page.