Enumerable#count can do three things. With no argument provided, it returns the number of items. With an argument, it returns the number of items matching the given value.
...directly from the database and create GIDs from them. # Note that we do not return GlobalID objects, but GID URI strings. columns = [primary_key] columns << inheritance_column if column_names.include?(inheritance...
..and prefer CSS, you may rewrite it: field.ancestor('div.form-group') Both versions will return the outermost matching element. Use the #order option find the closest parent: field.ancestor('div.form-group...
SELECT enum_range(NULL::portal) # Returns an array of all possible values SELECT unnest(enum_range(NULL::portal)) # Unnests the array and returns a row for each value Whereas portal...
...d even like to patch Prototype so it behaves like jQuery: Element.addMethods({ visible: function() { return offsetWidth > 0 && offsetHeight...
...actually keeps a list of custom identifiers. Other identifiers will not work and simply return nil. >> Time.zone_offset('BST') => nil >> Time.zone_offset('Berlin') => nil I'm confident there are other...
and focused.instance == "sun-awt-X11-XDialogPeer" and c.instance == "sun-awt-X11-XFramePeer" then return end if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end)
...with a very old version of Bundler. For reasons unknown, the Bundler dependency API returns different dependencies for some gems (like ruby-debug or rainpress) than the dependencies found in...
...OF_TEST_PACKETS $TARGET status=$? if [ $status -ne 0 ]; then mail_traceroute $TARGET fi return $status } function mail_traceroute { MTR_OUTPUT=$(mtr -n -r $@) HOSTNAME=$(hostname -f) mail -s "Monitoring...
...link or a press a button on a Selenium-controlled browser, the call will return control to your test before the next page is loaded. This can lead to concurrency...
code: | 15 | def type_cast_from_database(value) 5811 (5.4%) / 5811 (5.4%) | 16 | return if value.nil? 1661 (1.5%) / 1661 (1.5%) | 17 | value.to_i | 18 | end
...walk = document.createTreeWalker(node, NodeFilter.SHOW_TEXT, null, false) let nextNode while (nextNode = walk.nextNode()) { textNodes.push(nextNode) } return textNodes } keys.forEach((key) => { let nodes = textNodes(element) nodes.forEach((node) => { node.textContent = node.textContent.replace(new RegExp(key, 'gi...
...is a string containing a regular expression fragment ("OPTIMIZE|FIXME|TODO") and needs to return a regular expression that matches comments in the given file type. If you have other...
...check whether a secure connection is used: SHOW STATUS LIKE '%ssl_ciph%'; It should return something like this | Variable_name | Value | +-----------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Ssl_cipher | AES256-SHA | | Ssl_cipher_list | AES256-SHA...
width: auto; display: none; border: none; margin: 0; } Javascript ;(function($) { $.fn.fixHeader = function() { return this.each(function() { var $table = $(this), $t_fixed; function init() { $t_fixed = $table.clone(); $t_fixed.find('tbody').remove...
...users WHERE sites.user_id = sites.id AND users.name = 'Bruce' It now uses these IDs to return a new scope that has no joins and a single condition on the id column...
...You can query such an power as always: power = Power.new(@user) power.updatable_post?(Post.last) # return true if the author of the post is @user power.updatable_post!(Post.last) # raises Consul::Powerless...
You should see the details about the SMTP connection. You can return to your shell with Ctrl+c
...the arc cosine of a result like 1.0000000001. Since this is undefined, MySQL correctly returns NULL (instead of the expected distance of 0 for the circle's center).
...dove into another shell (e.g. with sudo su username) you will close it and return to the previous one. !! Repeat the previous command. Can be used inside other commands, e.g...
...by CSS selector .find(selector) one: .querySelector(selector), many: .querySelectorAll(selector) Test an element (returns boolean) .is(selector) .matches(selector) Test for class presence (boolean) .hasClass(class) .classList.contains(class)
...content").first.title # => ActiveRecord::MissingAttributeError The only exception from this is the id attribute which returns nil when you try to access it and did not select it.
...put the smarts back on the server. They invent new URLs which (for example) return a resource, but return it all wrapped up in the HTML needed to display it...
...part of the implementation that lives in Javascript, implement a Search.match(query) method that returns a promise. You should be able to use it like this: var query = // ...
...API so the client requests a JSON document instead of a HTML snippet. The returned JSON could look like this: { 'results': [ { 'title': 'Sunshine', 'year': 2007, 'detailsURL': '/movies/4012' }, { 'title': 'Before Sunset...