This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (global) { | |
'use strict'; | |
var | |
/** | |
* Attribute added by default to every highlight. | |
* @type {string} | |
*/ | |
DATA_ATTR = 'data-highlighted', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
While working with multiple branches we need to type the branch name all the time while pull and push the data | |
below are two small script that can help you with that | |
---- push.sh | |
BRANCH=$(git branch | grep ^* | sed 's/* //' ) | |
echo $BRANCH | |
git push origin $BRANCH | |
----pull.sh | |
BRANCH=$(git branch | grep ^* | sed 's/* //' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
u = User.find 1 | |
no_of_count = 1000 | |
Benchmark.bmbm do |x| | |
x.report("handle_asynchronously") { no_of_count.times { u.method_name_for_background_run } } | |
x.report("custom delayed job") { no_of_count.times { TestJob.new(u.id).delay } } | |
end | |
Output: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/company.rb | |
class Company < ActiveRecord::Base | |
searchable do | |
string :locations, multiple: true, stored: true do | |
["Location1", "Location2", "Location3"] | |
end | |
end | |
end |