Skip to content

Instantly share code, notes, and snippets.

@skshetry
skshetry / System Design.md
Created March 9, 2017 07:59 — 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?
@skshetry
skshetry / stack.cpp
Last active June 17, 2017 15:49
This was meant "To be API compatible" stack implementation with C++ STL stack that couldn't be and uses vector under the hood.
#include "stack.hpp"
////////////////////////////////// This is an implementation file ///////////////////////////////////////////////////////
///////////////////////////////// How to use this in your code? ///////////////////////////////////////////////////////
/*
First include "stack.hpp> in your source file at the top.
1. g++ -o <outputbinaryfilename> <yourfilename> stack.cpp
2. g++ -o stack.o -c stack.cpp
g++ -o main.o -c <yourfilename>
g++ -o main.o stack.o
*/
@skshetry
skshetry / infixconversion.cpp
Last active June 16, 2017 03:03
Implementation of algorithm to convert infix expressions to postfix and prefix expressions.
#include "lib/stack.hpp"
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <cctype>
using std::string;
using std::cin;
using std::cout;
#include <iostream>
using namespace std;
class Queue{
int data[1000];
int rear_pointer = -1;
public:
void enqueue(int incomindata){
data[++rear_pointer] = incomindata;
}
@skshetry
skshetry / result_check.py
Last active June 7, 2021 13:55
Python script that provides notification when result has arrived.(For IOE, using selenium and chromium driver. Providing notification using notify2 in GNOME)
import time # to sleep for some time
import logging #logging
from selenium import webdriver #selenium
from gi.repository import Notify #to provide notifications in GNOME
##################################################### Requirements ################################
#selenium
#chromedriver(bundled with chromium, separately available for google-chrome)
###################################################################################################
# config options

Keybase proof

I hereby claim:

  • I am skshetry on github.
  • I am skshetry (https://keybase.io/skshetry) on keybase.
  • I have a public key ASDl-yiBpPMCLwuFRMLhaTe-7WBdrHFWbXDdiP08X6N8Fwo

To claim this, I am signing this object:

@skshetry
skshetry / house.c
Last active March 1, 2018 15:22
a.c
#include <stdio.h>
#include <graphics.h>
inline void initWindow(){
cleardevice();
setlinestyle(SOLID_LINE, 0, THICK_WIDTH);
setbkcolor(BLACK);
return;
}
import difflib
import os
import re
import sys
from pathlib import Path
from PyQt5.QtCore import QRegExp
from PyQt5.QtGui import (QColor,
QIcon,
QSyntaxHighlighter,
def import_these(*pkg_args):
    return [import_this(pkg_str) for pkg_str in pkg_args]

def import_this(pkg_str: str):
    import importlib
    try:
        return importlib.import_module(pkg_str)
    except ModuleNotFoundError:
        print(f"The '{pkg_str}' module wasn't found."

Keybase proof

I hereby claim:

  • I am skshetry on github.
  • I am skshetry (https://keybase.io/skshetry) on keybase.
  • I have a public key whose fingerprint is 3C0A 8962 9BFA 5C16 B7B3 C730 424B DDBA 58C0 953D

To claim this, I am signing this object: