Skip to content

Instantly share code, notes, and snippets.

View prateekguptaiiitk's full-sized avatar
:octocat:
Just GitHubing

Prateek Gupta prateekguptaiiitk

:octocat:
Just GitHubing
View GitHub Profile
@prateekguptaiiitk
prateekguptaiiitk / singly-linked-list.py
Last active February 14, 2023 17:39
Collection of all operations on a singly linked list
class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
# print linked list
version: "3.7"
x-common-props: &common-props
build:
context: ./
target: base
working_dir: /base
volumes:
- ./app:/base
- node_modules:/base/node_modules
@prateekguptaiiitk
prateekguptaiiitk / Dockerfile
Created October 7, 2020 15:56
Dockerfile for nextjs apps
FROM node:current-alpine AS base
WORKDIR /base
COPY package*.json ./
RUN npm install
COPY . .
FROM base AS build
ENV NODE_ENV=production
WORKDIR /build
COPY --from=base /base ./
@prateekguptaiiitk
prateekguptaiiitk / Firebase.js
Created September 29, 2020 21:05
Basic way to initialize firebase for web
import firebase from "firebase/app";
import "firebase/auth";
import "firebase/firestore";
import "firebase/functions";
import "firebase/storage";
import "firebase/messaging";
import "firebase/performance";
const config = {
// set your config here
@prateekguptaiiitk
prateekguptaiiitk / .gitignore
Created August 9, 2020 10:35
.gitignore for react projects
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
@prateekguptaiiitk
prateekguptaiiitk / System Design.md
Created August 4, 2020 13:26 — 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?

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am