Skip to content

Instantly share code, notes, and snippets.

View rishiip's full-sized avatar
🎯
Focusing

Rishi Pithadiya rishiip

🎯
Focusing
View GitHub Profile
@rishiip
rishiip / prettier-eslint-precommit.md
Created January 10, 2023 09:04 — forked from estorgio/prettier-eslint-precommit.md
Setting up Prettier and ESLint with pre-commit hook

Setting up Prettier and ESLint with pre-commit hook

  • Initialize Git repository
    git init
  • Create .gitignore file and add the following:
    node_modules/
    *.env
    
@rishiip
rishiip / learning_basic_ruby.ipynb
Created June 5, 2021 07:32
Learning Basic Ruby
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rishiip
rishiip / gist:55014929f8341e8a942dee4ff3cb6de4
Created June 6, 2020 16:42 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@rishiip
rishiip / The Technical Interview Cheat Sheet.md
Created June 6, 2020 16:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@rishiip
rishiip / consider_my_requests_local.rb
Created May 27, 2020 18:21 — forked from skojin/consider_my_requests_local.rb
same as config.consider_all_requests_local but for production and only for specified ip address, rails 3.2
silence_warnings do
ActionDispatch::Request::LOCALHOST = (ActionDispatch::Request::LOCALHOST + ['192.168.0.1']).freeze
end
ActionController::Base.module_eval do
def show_detailed_exceptions?
request.local?
end
end
@rishiip
rishiip / irb_require_without_bundler_hack.rb
Created May 27, 2020 17:34 — forked from skojin/irb_require_without_bundler_hack.rb
workaround to load irb specific gem (loaded in .irbrc) in bundler environment, like rails3 console
# Add all gems in the global gemset to the $LOAD_PATH so they can be used in rails3 console with bundler
if defined?(::Bundler)
$LOAD_PATH.concat Dir.glob("#{ENV['rvm_path']}/gems/#{ENV['rvm_ruby_string']}@global/gems/*/lib")
end
@rishiip
rishiip / mongoid_counter_cache.rb
Created May 24, 2020 14:59 — forked from jeffreyiacono/mongoid_counter_cache.rb
counter cache extension for mongoid orm
module Mongoid
module CounterCache
extend ActiveSupport::Concern
module ClassMethods
# Use Case:
#
# keep a cached count of embedded collections in the parent collection(s)
#
# for example, if a Post embeds many Comments, and there have been 2
module MyProject
module Mongoid
module Document
extend ActiveSupport::Concern
included do
include ::Mongoid::Document
include ::Mongoid::Timestamps
include ::Mongoid::DotNotation
include ::Mongoid::SearchForObject
end
@rishiip
rishiip / kb.json
Created September 17, 2019 09:37 — forked from pkaminski/gist:1ea3df5301660ddc5b12
Custom key bindings for Reviewable
[
["n", "Next unreviewed file", "nextUnreviewedFile()"],
["p", "Previous unreviewed file", "prevUnreviewedFile()"],
["shift+n", "Next file", "nextFile()"],
["shift+p", "Previous file", "prevFile()"],
["x", "Mark file as reviewed / unreviewed", "toggleCurrentFileReviewed(); nextUnreviewedFile()"],
["j", "Next unreplied comment", "nextUnrepliedDiscussion()"],
["k", "Previous unreplied comment", "prevUnrepliedDiscussion()"],
["shift+j", "Next comment", "nextDiscussion()"],
["shift+k", "Previous comment", "prevDiscussion()"],
@rishiip
rishiip / gist:2eeef32fb087c0ecc18136df3c1f89b8
Created September 14, 2019 15:57 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master