With gem dependency it is possible to check the dependencies for your gem before you install it.

Although regular expression syntax is 99% interchangeable between languages, keep this in mind: By default, the dot character (".") does not match a line feed (newline, line break, "\n") in any...

...use the /s modifier in Ruby. It changes the RegExp to interpret text as Shift JIS encoded which you probably don't want. Javascript There is no modifier to make...

github.com

...records of a Ruby on Rails ActiveRecord model to be organised as a tree structure (or hierarchy). It uses a single, intuitively formatted database column, using a variation on the...

...materialised path pattern. It exposes all the standard tree structure relations (ancestors, parent, root, children, siblings, descendants) and all of them can be fetched in a single sql query. Additional...

github.com

An unresponsive service can be worse than a down one. It can tie up your entire system if not handled properly. All network requests should have a timeout.

...You should avoid Ruby’s Timeout module. The default is no timeout, unless otherwise specified. Enjoy...

makandra dev
stdgems.org

Ruby's standard library is in the process of being gemified. It will soon - Ruby 2.5 - consist of RubyGems, which can be updated independently from Ruby. This might mean smoother...

...Ruby upgrades in the future. If breaking API changes happen in standard gems, we can update these before upgrading Ruby...

github.com

The Bullet gem is designed to help you increase your application's performance by reducing the number of queries it...

playbook.cio.gov

The The U.S. Digital Services Playbook is pretty amazing (context...

material.angularjs.org

...to the Polymer project's paper elements collection. Our goal is to provide a set of AngularJS-native UI elements that implement the material design system...

adobe.com

Holly Schinsky from Adobe shows some of Bootstrap's capabilities. The combination of explanation, screenshots and source code makes it easy to understand

ghacks.net

...users will receive update notifications in April offered through the browser’s internal updating service that will update the version to the latest stable build of the browser...

So you want to know if you are on natty, precise, quantal, or something else? Check /etc/lsb-release. $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION...

...can view with crontab -l and edit with crontab -e. You'll need to su to the respective user to view or edit her crontab...

...the code below to check whether the browser can make connections to the current site: await isOnline() // resolves to true or false The code The isOnline() function below checks if...

...you can make real requests by re-fetching your site's favicon. If the favicon cannot be downloaded within 6 seconds, it considers your connection to be offline. async function...

...You very likely have a model that has a delay attribute. You can configure Sidekiq to remove its delay method by adding this to your Sidekiq initializer: Sidekiq.remove_delay!

...you need to keep Sidekiqs delay features, add Sidekiq.hook_rails! before the option above. The sidekiq methods will be prefixed with sidekiq_ then...

...implementation changes. The information below is validated for the current list of browsers we support. By default your html and body elements are only as high as the actual page...

...html and body elements will only be around 40 pixels high, regardless of the size of your browser window. You might be surprised by this, since setting a background on...

...s calc(100 - l)); Here is what happens: from currentColor tells hsl() to start with the value of currentColor. calc(h + 180) rotates the color hue by 180 degrees, i.e...

...to the opposite of the color wheel. s keeps saturation unchanged. calc(100 - l) inverts lightness. For example, 0% becomes 100%, and 100% becomes 0%. Example usage .demo { --inverted-color...

...for gems allows to add metadata to your gem, some of which have a special meaning and are helpful for users. You can provide links to your Github bugtracker or...

...file that are then used on the rubygems page of your gem (in the sidebar, e.g. see gem page of consul). Here are some keys that should be filled:

...desktop users may encounter some weird quirks: Aside from allowing only digits and decimal separators, an "e" is also allowed (to allow scientific notation like "1e3"). Non-technical users will...

...be confused by this. Your server needs to understand that syntax. If it converts only digits (e.g. to_i in Ruby) you'll end up with wrong values (like...

When building an application that sends e-mails to users, you want to avoid those e-mails from being classified as spam. Most obvious scoring issues will not be relevant...

...to you because you are not a spammer. However, your application must do one thing by itself: When sending HTML e-mails, you should include a plain-text body or...

jimneath.org

...lists and explains global Ruby "dollar" variables, such as: $: (load path) $* (ARGV) $? (Last exit status) $$ (PID) $~ (MatchData from last successful match) ...and many more you'll need when reading weird...

$1 $2 $3 $4 (match groups from the last pattern match) $& (last matched string) $+ (last match group) `$`` (the string before the last match) $' (the string after the last match...

Event delegation is a pattern where a container element has a single event listener that handles events for all descendants that match a CSS selector. This pattern was popularized by...

...element was clicked!") }) This technique has some advantages: When you have many descendants, you save time by only registering a single listener. When the descendants are changed dynamically via JavaScript...

Both knapsack and parallel_tests have the option to split groups by historic execution time. The required logs for this might be outdated since you manually have to update and...

...consistently up to date with no extra effort locally and/or remotely. How to always split by execution logs Parallel Tests The parallel_tests gem has the option flag --group-by...

...config={}). There also is a generate method which will run the generator in a subprocess. Call it with generate 'generator_name', 'command line args'. Expected (hard-coded) directory structure of...

... #{generator name, e.g. model}_generator.rb USAGE Templates If you want to use the supplied template, directory and other template methods, you must call source_root 'path/to/templates' inside your generator...

Fixed bugs where calling valid? would change the record's state...