Skip to content

Instantly share code, notes, and snippets.


Gaurav Sachdeva grvsachdeva

View GitHub Profile
grvsachdeva / merge_locales.rb
Last active Feb 3, 2019 — forked from munen/merge_locales.rb
Interactively merge several YAML files into one
View merge_locales.rb
#!/usr/bin/env ruby
# synopsis
# ruby merge_locales.rb config/locales <language-code>
require 'yaml'
require 'rubygems'
require 'highline/import'

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

grvsachdeva /
Created May 29, 2018 — forked from piscisaureus/
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

grvsachdeva /
Last active Jul 21, 2019
Open Source and Plots2 handy guide for help

Making a Migration (Plots2)

One have to run this migration locally and then update the schema.rb.example corresponding to updates in their local schema.rb file and then copy the checksum into the top of schema.rb.example.

Getting any branch from origin(Git repo on account)

git checkout --track origin/branch_name

Fetching Pull Request branch

git fetch repo pull/7324/head:pr-7324


grvsachdeva /
Last active Mar 14, 2018
PART 1 : Reply by Email to comments

Reply by Email to Comment


Implementation of feature using which PublicLab users can comment directly on the node(question ,research note,event) just by replying to the email(notification email which users recieve on creation of new node)

Gem used 💎:

Mailman gem - A microframework for processing incoming email.

Implementation Steps:-

grvsachdeva / close_friends.rb
Last active Mar 11, 2018
This ruby code print the names of all people residing in locations within 100 Km (For testing change 100 at line 111 to 10000 as faker gem generates random coordinates which has distance much greater than 100km )
View close_friends.rb
require 'rubygems'
require 'json'
require 'pp'
require 'faker'
class Close
attr_accessor :id, :name
@@array =
def self.all_instances
grvsachdeva / sumOfThreeNums.rb
Last active Mar 11, 2018
This Ruby code takes number of elements , array elements and sum to be found from user and print if there is any triplet present in array equating to sum provided
View sumOfThreeNums.rb
#Code with O(n^3) complexity
def finding_elements arr,sum,arr_size
for i in 0...arr_size-2
for j in i+1...arr_size-1
for k in j+1...arr_size
if (arr[i] + arr[j] + arr[k] === sum)
print "Elements summing to #{sum} are : ",arr[i]," ",arr[j]," ",arr[k];