jq 'map(.foo)'
[ { foo: 1 }, { foo: 2 } ]
[1, 2]
| <script type="text/javascript"> | |
| // getQueryParams | |
| //This grabs the UTM parameters from the URL | |
| function getQueryParams(qs) { | |
| qs = qs.split("+").join(" "); | |
| var params = {}, tokens, | |
| re = /[?&]?([^=]+)=([^&]*)/g; | |
| while (tokens = re.exec(qs)) { | |
| params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); | |
| } |
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
| # Has your OS/FS/disk lost your data? | |
| # cd to the directory containing your project repositories and run the command | |
| # below. (It's long; make sure you get it all.) It finds all of your git repos | |
| # and runs paranoid fscks in them to check their integrity. | |
| (set -e && find . -type d -and -iname '.git' | while read p; do (cd "$(dirname "$p")" && (set -x && git fsck --full --strict)); done) && echo "OK" | |
| # I have 81 git repos in my ~/proj directory and had no errors. |
| class MyModel < ActiveRecord::Base | |
| belongs_to :owner, polymorphic: true | |
| ransacker :owner_name, formatter: proc { |value| | |
| # To use this, you have to know what all of the possible owner types can be. | |
| # For this example, the #owner_type could be either Group or Advertiser. | |
| # The fields we want to search on are: | |
| # Group#name | |
| # Advertiser#contact_name | |
| # |
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
| matcher | aliased to | description |
|---|---|---|
| a_truthy_value | be_truthy | a truthy value |
| a_falsey_value | be_falsey | a falsey value |
| be_falsy | be_falsey | be falsy |
| a_falsy_value | be_falsey | a falsy value |
| # RSpec matcher to spec delegations. | |
| # Forked from https://gist.github.com/ssimeonov/5942729 with fixes | |
| # for arity + custom prefix. | |
| # | |
| # Usage: | |
| # | |
| # describe Post do | |
| # it { should delegate(:name).to(:author).with_prefix } # post.author_name | |
| # it { should delegate(:name).to(:author).with_prefix(:any) } # post.any_name | |
| # it { should delegate(:month).to(:created_at) } |
| #!/usr/bin/env ruby | |
| pattern = /^```(.*)/ | |
| capturing = false | |
| language = '' | |
| lines = {} | |
| File.open(ARGV.shift).each_line do |line| | |
| match = pattern.match(line) |
| Selectize.define('selectable_placeholder', function( options ) { | |
| var self = this; | |
| options = $.extend({ | |
| placeholder: self.settings.placeholder, | |
| html: function ( data ) { | |
| return ( | |
| '<div class="selectize-dropdown-content placeholder-container">' + | |
| '<div data-selectable class="option">' + data.placeholder + '</div>' + | |
| '</div>' |