Skip to content

Instantly share code, notes, and snippets.

View mgill25's full-sized avatar

Manish Gill mgill25

View GitHub Profile
;; Programming Languages, Homework 5
#lang racket
(provide (all-defined-out)) ;; so we can put tests in a second file
;; definition of structures for MUPL programs - Do NOT change
(struct var (string) #:transparent) ;; a variable, e.g., (var "foo")
(struct int (num) #:transparent) ;; a constant number, e.g., (int 17)
(struct add (e1 e2) #:transparent) ;; add two expressions
(struct ifgreater (e1 e2 e3 e4) #:transparent) ;; if e1 > e2 then e3 else e4
mgill25 /
Created April 21, 2022 13:18
Crackle Pop
def gen_pop(limit):
for num in range(1, limit):
if num % 3 == 0 and num % 5 == 0:
yield "CracklePop"
elif num % 3 == 0:
yield "Crackle"
elif num % 5 == 0:
yield "Pop"
yield num

R - NaeblisEcho

#!/usr/bin/env python
def bin(x):
return "{0:b}".format(x)
def rs_one(x):
""" Right Shift by 1 """
return x >> 1
def ls_one(x):
mgill25 /
Last active May 7, 2019 09:25 — forked from dusual/
Distributed Systems meetup group Delhi


We intend to bring a distributed systems meetup group to Delhi. We are inspired by @nishantmodak and @ShripadAgashe who have been running the meetups and conferences in Pune. Please, go through their previous meetups at @dist_sys. We want to be the space where people can talk about the various problems they have been solving around distributed systems and hopefully try and bring more academicians and engineers from industry to talk about the theoretical principles and practical experience building reliable and consistent systems on top the entropy that usually comes with distributed systems.

Looking for

We are looking for all kinds of people who can help us get going with the group. Speakers, potential attendees, sponsors, volunteers etc .. So if you are interested in the idea, please shout out to us:

mgill25 / Advanced Bash Usage
Created May 7, 2017 16:22 — forked from projectivemotion/Advanced Bash Usage
Cheatsheet of advanced bash commands presented in Introduction to Advanced Bash Usage - James Pannacciulli. Youtube:


A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

mgill25 / latency.txt
Created January 15, 2016 20:29 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
mgill25 /
Created May 7, 2013 12:14
Mailman Model Prototype for Lists and Members
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models
# Conceptual Model representation in the Mailman API
class Member(models.Model):
name = models.CharField(max_length=200)
mgill25 / The Technical Interview Cheat
Last active September 4, 2015 06:44 — forked from tsiege/The Technical Interview Cheat
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.