Angular Filters
A collection of useful filters for AngularJS, e.g. for fuzzy string searching, displaying numbers as percentages an more.
Related cards:
A collection of useful design resources for developers
This collection contains some useful design resources for developers. Many of them were mentioned in the Refactoring UI tutorials.
Tutorials
- Refactoring UI Videos
- [Refactori...
How to define height of a div as percentage of its variable width
This is useful if, for example, you want to use a background-image that has to scale with the width and the div should only have the height of the picture.
html:
<div class="outer">
<div class="inner">
</div>
</div>
css:...
How to build the perfect number of blank records for a nested form
When you render a nested form for a Movie
which has_many :actors
, you want to render the right number of blank Actor
forms. The right number means:
- A minimum number of blank forms so the user can add more
Actors
to an existingMovie
, ...
The Ruby Toolbox – a collection of good gems
If you need a gem for a certain purpose, be sure to check this site.
The rankings are determined by counting up the number of forks and watchers of various github projects, so I'd view it less as "this is what I should be using," and more ...
A collection of SVG Logos for developers
A collection of 700+ svg vector logos. The logos are optimized (removed duplicated paths / excessive groups / empty defs, linting, etc).
Almost 100 logos were recreated from rastered images #vectorized.
All logos appearing on the site are the...
JavaScript: Testing the type of a value
Checking if a JavaScript value is of a given type can be very confusing:
- There are two operators
typeof
andinstanceof
which work very differently. - JavaScript has some primitive types, like string literals, that are not objects (as oppose...
In MySQL, a zero number equals any string
In MySQL comparing zero to a string 0 = "any string"
is always true!
So when you want to compare a string with a value of an integer column, you have to cast your integer value into a string like follows:
SELECT * from posts WHERE CAST(po...
Angular-xeditable :: Edit in place for AngularJS
Angular-xeditable is a bundle of AngularJS directives that allows you to create editable elements.
Such technique is also known as click-to-edit or edit-in-place.
It is based on ideas of x-editable but was written from scratch to use power...
Generate a path or URL string from an array of route components
When 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 ... end
# same as:
form_for([:admin, @user]) do ... end
Same for link_to:
link_to("Label", edit_admin_u...
MySQL: For each group, retrieve a comma-separated list of values in a given column
The technique described in this card has an important caveat: The result of GROUP_CONCAT
is truncated to the maximum length that is given by the group_concat_max_len
system variable, which has a default value of 1024. **This will cause hor...