Skip to content

Instantly share code, notes, and snippets.

View grvsachdeva's full-sized avatar

Gaurav Sachdeva grvsachdeva

View GitHub Profile
@grvsachdeva
grvsachdeva / close_friends.rb
Last active March 11, 2018 11:59
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 )
require 'rubygems'
require 'json'
require 'pp'
require 'faker'
class Close
attr_accessor :id, :name
@@array = Array.new
def self.all_instances
@grvsachdeva
grvsachdeva / sumOfThreeNums.rb
Last active March 11, 2018 11:59
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
#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];
puts;
@grvsachdeva
grvsachdeva / reply_by_email.md
Last active March 14, 2018 18:33
PART 1 : Reply by Email to comments

Reply by Email to Comment

Goal:

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
grvsachdeva / GSoC_final.md
Last active March 27, 2018 11:45
Final Proposal here
@grvsachdeva
grvsachdeva / pr.md
Created May 29, 2018 18:17 — forked from piscisaureus/pr.md
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 = git@github.com:joyent/node.git

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
grvsachdeva / first-timer-issue.md
Last active January 13, 2019 19:37
first-timer-issue

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
grvsachdeva / merge_locales.rb
Last active February 3, 2019 22:42 — forked from munen/merge_locales.rb
Interactively merge several YAML files into one
#!/usr/bin/env ruby
#
# synopsis
#
# ruby merge_locales.rb config/locales <language-code>
require 'yaml'
require 'rubygems'
require 'highline/import'
@grvsachdeva
grvsachdeva / plots2_oss.md
Last active July 21, 2019 10:50
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

where,