Skip to content

Instantly share code, notes, and snippets.

View rajeevkannav's full-sized avatar

Rajeev Sharma rajeevkannav

View GitHub Profile
@rajeevkannav
rajeevkannav / InstallPopcornTime.md
Created December 8, 2018 08:24 — forked from flyingluscas/InstallPopcornTime.md
Installing Popcorn Time on Ubuntu 16.x

1. Downloading

32 bits version

$ wget https://get.popcorntime.sh/build/Popcorn-Time-0.3.10-Linux-32.tar.xz -O popcorntime.tar.xz

64 bits version

@rajeevkannav
rajeevkannav / System Design.md
Last active October 23, 2018 10:45 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@rajeevkannav
rajeevkannav / The Technical Interview Cheat Sheet.md
Created September 20, 2018 12:35 — 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.

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.
@rajeevkannav
rajeevkannav / kaminari.rb
Created September 5, 2018 13:22
Skip Total Count view information if there is no filter
module ActiveAdmin
module Views
class PaginatedCollection < ActiveAdmin::Component
protected
# modified from will_paginate
def page_entries_info(options = {})
if options[:entry_name]
entry_name = options[:entry_name]
@rajeevkannav
rajeevkannav / collactions.md
Last active July 18, 2018 12:21
HelpFull Links Actually Great Ones
@rajeevkannav
rajeevkannav / PostgreSQL-Ubuntu.md
Last active June 28, 2022 13:55
PostgreSQL (10.4 (Ubuntu 10.4-2.pgdg16.04+1)) Ubuntu 16.04.4 LTS

PostgreSQL (10.4 (Ubuntu 10.4-2.pgdg16.04+1)) Ubuntu 16.04.4 LTS

Installation

https://www.postgresql.org/download/linux/ubuntu/

Create the file /etc/apt/sources.list.d/pgdg.list and add a line for the repository

deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main

@rajeevkannav
rajeevkannav / manjula.rb
Created April 19, 2018 12:05
manjula.rb
require 'json'
x = JSON.parse('{
"@context": [
"https://opencontext.org/contexts/search.json",
"http://geojson.org/geojson-ld/geojson-context.jsonld"
],
"id": "http://opencontext.org/subjects-search/Turkey/Kenan+Tepe.json",
"label": "Open Context API",
"dcmi:modified": "2018-01-31T03:20:58Z",
"dcmi:created": "2012-06-30T00:00:00Z",
#first generate a key for your domain
openssl genrsa -out yourdomain.com.key 2048
#then generate the request
openssl req -new -key yourdomain.com.key -out yourdomain.com.csr
@rajeevkannav
rajeevkannav / deploy.rb
Created December 1, 2017 05:23
Mina Deploy Ubuntu 17.10-From Scratch-Rails-Ruby-Mysql-Nginx-Puma and all possible option
require 'mina/rails'
require 'mina/git'
require 'mina/puma'
require 'mina/rvm'
require 'yaml'
set :user, 'deploy'
set :port, '22'
set :forward_agent, true
set :term, :system
@rajeevkannav
rajeevkannav / bullsandcows.rb
Last active November 30, 2017 16:23
Write a command line program in ruby that accurately and efficiently guesses the word in 4 letter word Cows and Bulls game.
class RepeatedCharactorFound < StandardError
def message
"Repeated charactors are not allowed. Please Try again."
end
end
class MinimumLengthRequired < StandardError
def message
"Charactor length must be equal to four. Please Try again."
end
end