Meny - A three dimensional and space efficient menu concept
Stuff like this is now possible in Webkit browsers, Firefox and IE10.
Related cards:
RubyMine: Find and execute a menu action by its name
You are looking for a functionality in RubyMine but don't know or remember its keyboard shortcut or which menu it is located in?\
Hit Ctrl+Shift+A
.
This will bring up the "Find Action" box where you can enter an action's name or category. Pick...
Test-Driven Development with integration and unit tests: a pragmatic approach
Test-Driven Development (TDD) in its most dogmatic form (red-green-refactor in micro-iterations) can be tedious. It does not have to be this way! This guide shows a pragmatic approach with integration and unit tests, that works in practice and imp...
Stripping all non-word-characters (a.k.a \W) and preserve diacritics (a.k.a Umlaute) in utf-8
Sometimes you want to strip a text of every special char. If you use \W, the result might not be what you wanted:
irb> "Eine längliche Kristall §$&&%& Lampe über dem Esstisch verschönert jedes noch so kahle \n Speisezimmer".gsub(/\W+/,...
Ruby: Indent a string
Copy the attached file to config/initializers/indent_string.rb
and you can say
"foo".indent(4) # " foo"
Note you will find many simpler implementations of this method on the Interweb. They probably won't do what you want in edge cases, ...
Generate a Unicode nonbreaking space in Ruby
Regular spaces and non-breaking spaces are hard to distinguish for a human.
Instead of using the
HTML entity or code like " " # this is an nbsp
, use a well-named helper method instead.
def nbsp
[160].pack('U*')
end
1...
How to generate and test a htpasswd password hash
Generate a password
htpasswd -Bn firstname.lastname
This will ask you for a password and use bcrypt (-B
, more secure) and print the output to stdout (-n
).
Check if password matches the hash
You'll first have to write the pass...
When I give a button and a link the same styles, why is the link one pixel higher?
It's not logical, so don't be too hard on yourself. You need to give it a height and change the box-sizing
and display
:
button
input[type="reset"],
input[type="button"],
input[type="submit"],
input[type="file"] > input[typ...
Keyboard Navigation Plugin for Safari, Chrome and Firefox with a rich feature set
gleeBox is an experimental project that takes a keyboard-centric approach to navigating the web. It provides alternatives to actions that are traditionally performed via the mouse. Some of these are radically more efficient than using a mouse, s...
iPhone on Rails and ObjectiveResource; Making communication between the iPhone and a Rails web-service pain-free.
ObjectiveResource is an Objective-C port of Ruby on Rails' ActiveResource. It provides a way to serialize objects to and from Rails' standard RESTful web-services (via XML or JSON) and handles much of the complexity involved with invoking web-serv...
Git: Diff changes in a long line efficiently
Instead of showing you two lines for each change, Git allows you to highlight changes in a line explicitly:
git diff --word-diff some_file
Hello [-world-]{+universe+}!
(The result is usually colored nicely, the removed part being red...