Skip to content

Instantly share code, notes, and snippets.

View sumanssaurabh's full-sized avatar
🏠
Working from home

Suman Saurabh sumanssaurabh

🏠
Working from home
View GitHub Profile
@sumanssaurabh
sumanssaurabh / nginxproxy.md
Created January 20, 2021 00:17 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@sumanssaurabh
sumanssaurabh / semaphore.js
Created September 13, 2020 13:31 — forked from gregkorossy/semaphore.js
A simple implementation of a semaphore in JS
function Semaphore(max) {
var counter = 0;
var waiting = [];
var take = function() {
if (waiting.length > 0 && counter < max){
counter++;
let promise = waiting.shift();
promise.resolve();
}
@sumanssaurabh
sumanssaurabh / download.py
Created February 13, 2020 18:35 — forked from mie00/download.py
pdf free books
# -*- coding: utf-8 -*-
import re
import urllib
from multiprocessing import Pool
import requests
import progressbar
CHUNK_SIZE = 1024 * 1024 # 1MB
def download(i):

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@sumanssaurabh
sumanssaurabh / master-javascript-interview.md
Created April 3, 2019 18:03 — forked from Geoff-Ford/master-javascript-interview.md
Eric Elliott's Master the JavaScript Interview Series
@sumanssaurabh
sumanssaurabh / The Technical Interview Cheat Sheet.md
Created March 31, 2019 23:29 — 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.
@sumanssaurabh
sumanssaurabh / 0-startup-overview.md
Created March 31, 2019 23:15 — forked from dideler/0-startup-overview.md
Startup Engineering notes
@sumanssaurabh
sumanssaurabh / vanilla-js-cheatsheet.md
Created March 31, 2019 23:08 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@sumanssaurabh
sumanssaurabh / gist:9a394f2451725c75fd47acb07eb45a63
Created March 31, 2019 23:07 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@sumanssaurabh
sumanssaurabh / gist:cde2be76da6c3e3ce8e9b905da7a195c
Created March 31, 2019 23:06 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.