Skip to content

Instantly share code, notes, and snippets.

View dilkhush's full-sized avatar

Dilkhush soni dilkhush

  • Neev Technologies Pvt. Ltd.
  • Bangalore
View GitHub Profile
(function (global) {
'use strict';
var
/**
* Attribute added by default to every highlight.
* @type {string}
*/
DATA_ATTR = 'data-highlighted',
@dilkhush
dilkhush / current_branch_pull_and_push.txt
Last active September 15, 2016 09:11
Working with multiple branches taking pull and push with current branch
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/* //' )
@dilkhush
dilkhush / handle_asynchronously_vs_custom_delayed_job_benchmark.txt
Last active January 19, 2018 09:01
Delayed_job #handle_asynchronously Vs custom delayed job benchmarking
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:
@dilkhush
dilkhush / Solr_Atomic_update
Created February 2, 2018 10:55
Solr Atomic update issue with multiple true fields
# app/models/company.rb
class Company < ActiveRecord::Base
searchable do
string :locations, multiple: true, stored: true do
["Location1", "Location2", "Location3"]
end
end
end