Skip to content

Instantly share code, notes, and snippets.

🤓
Learning / Developing / Working

Gaurav Sachdeva gauravano

🤓
Learning / Developing / Working
Block or report user

Report or block gauravano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gauravano
gauravano / 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'
View first-timer-issue.md

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.

@gauravano
gauravano / pr.md
Created May 29, 2018 — forked from piscisaureus/pr.md
Checkout github pull requests locally
View pr.md

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:

@gauravano
gauravano / plots2_oss.md
Last active Jul 21, 2019
Open Source and Plots2 handy guide for help
View plots2_oss.md

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,

@gauravano
gauravano / reply_by_email.md
Last active Mar 14, 2018
PART 1 : Reply by Email to comments
View reply_by_email.md

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:-

@gauravano
gauravano / 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 = Array.new
def self.all_instances
@gauravano
gauravano / 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];
puts;
You can’t perform that action at this time.