Skip to content

Instantly share code, notes, and snippets.

Manoj Sehrawat manoj2411

Block or report user

Report or block manoj2411

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
@manoj2411
manoj2411 / The Technical Interview Cheat Sheet.md
Created May 8, 2018 — 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.
View The Technical Interview Cheat Sheet.md

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@manoj2411
manoj2411 / sidekiq_manager.rb
Created Nov 16, 2017 — forked from kcore/sidekiq_manager.rb
a load balancer for sidekiq jobs!
View sidekiq_manager.rb
module Amura
class SidekiqManager
# a datastructure to maintain queue meta data. the structure of which is {host_name: {queue_name:{min:1,max:1,conc:10,latency:1,queue_size:10,kill_idle:-1, tags:['default'], total_checks:1,current_check:0}}}
# host_name - name of the machine where its running. useful in a distributed environment where app is running on mulitple instances
# queue_name - name of the queue (which you can mention in the sidekiq worker as sidekiq_options :queue => :mailer )
# min: minimum number of processes required to process this queue on this machine.
# max: maximum number of processes permitted to process this queue on this machine. a upper limit to avoid memory overflow and unlimited process spawning.
# conc: concurreny (number of worker threads) for each of the processes. this is -C option given while booting up sidekiq.
# latency: this is the default safe latency which is permissable for this queue. anything beyond this will trigger new p
@manoj2411
manoj2411 / gemrc
Created Jun 28, 2015
No ri & no rdoc
View gemrc
gem: --no-ri --no-rdoc
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
@manoj2411
manoj2411 / module_with_personalised_method_names.rb
Last active Aug 29, 2015
A module that shares code with personalised method names with respect to class
View module_with_personalised_method_names.rb
module ModuleWithPersonalisedMethods
def self.included(klass)
@methods_definer.call(klass)
end
@methods_definer = lambda do |klass|
klass_name = klass.name.downcase
klass.class_exec do
define_method "#{klass_name}_m1" do |arg1 = nil|
@manoj2411
manoj2411 / Gem dev.rb
Last active Aug 29, 2015
minimum gem for development
View Gem dev.rb
group :development do
gem 'annotate'
gem 'better_errors'
gem 'binding_of_caller'
gem 'bullet'
gem 'mailcatcher'
gem 'pry-rails'
gem 'quiet_assets'
gem 'xray-rails'
end
@manoj2411
manoj2411 / application.rb
Last active Aug 29, 2015
Rails application config to skip auto generators.
View application.rb
class Application < Rails::Application
# ...
config.generators do |g|
g.test_framework false
g.scaffold_controller "scaffold_controller"
g.stylesheets false
g.javascripts false
g.helper false
end
end
View jsv.sublime-snippet
<snippet>
<content><![CDATA[
javascript:void(0)
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>jsv</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
View sort_word.rb
str = "the house is blue, it looks beautiful."
puts 'Initial string: ' + str
words_arr = []
i = 0
tmp_word = ''
while(i <= str.length)
You can’t perform that action at this time.