Skip to content

Instantly share code, notes, and snippets.

View rishi-amura's full-sized avatar
🚫
Code doesn't lie, comments sometimes do.

Pitthu rishi-amura

🚫
Code doesn't lie, comments sometimes do.
View GitHub Profile
@rishi-amura
rishi-amura / IndianCities.json
Created February 11, 2016 12:23 — forked from shubhamjain/IndianCities.json
Indian States and their Cities
{
"AP":[
"Adilabad",
"Anantapur",
"Chittoor",
"Kakinada",
"Guntur",
"Hyderabad",
"Karimnagar",
"Khammam",
@rishi-amura
rishi-amura / install.md
Created July 20, 2016 09:06 — forked from galulex/install.md
Ruby On Rails Ubuntu 16.04 install

Developer libs

mysql, rmagic, curl, git, vim, sqlite, nodejs nokogiri...

sudo apt-get install libxslt1-dev libxml2-dev libmagickwand-dev imagemagick libsqlite3-dev libcurl4-openssl-dev curl git git-gui vim-gtk exuberant-ctags nodejs nodejs-legacy rar

Ruby

sudo apt-add-repository ppa:brightbox/ruby-ng

sudo apt-get update

@rishi-amura
rishi-amura / NERDTree.mkd
Created May 8, 2018 07:32 — forked from m3nd3s/NERDTree.mkd
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@rishi-amura
rishi-amura / gmail-github-filters.md
Created October 26, 2018 07:07 — forked from ldez/gmail-github-filters.md
Gmail and GitHub - Filters

Gmail and GitHub

Create new filters and create new labels.

Pull Request

from:(notifications@github.com) AND {"Patch Links" "approved this pull request." "requested changes on this pull request." "commented on this pull request." "pushed 1 commit." "pushed 2 commits." "pushed 3 commits."}

label: gh-pull-request

@rishi-amura
rishi-amura / symbols.md
Created October 31, 2018 13:25 — forked from ryansobol/symbols.md
Symbols in Ruby

What's a Symbol and why is it imporant?

In Ruby, a Symbol is the most efficient way, in terms of time and memory, to represent a set of characters.

What does a Symbol look like?

Most commonly, a Symbol is a single word prefixed by a colon:

:hello
@rishi-amura
rishi-amura / script_to_round_off_values.rb
Last active November 11, 2019 13:34
[ESTATE-6703] Round off Saleable/Carpet/Loading values
# ESTATE-6703
Client.all.each do |client|
client.unit_configurations.each do |u|
u.update_attributes(saleable: u.saleable.round(4), carpet: u.carpet.round(4), loading: u.loading.round(4))
end
client.project_units.each do |pu|
pu.update_attributes(saleable: pu.saleable.round(4), carpet: pu.carpet.round(4), loading: pu.loading.round(4))
end
end
@rishi-amura
rishi-amura / Search my gists.md
Created December 8, 2019 14:14 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files. language:html

@rishi-amura
rishi-amura / Local PR test and merge.md
Created January 14, 2020 09:56 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37