Skip to content

Instantly share code, notes, and snippets.

View arijitAD's full-sized avatar
👨‍💻

Arijit Das arijitAD

👨‍💻
View GitHub Profile
@bradtraversy
bradtraversy / npmcrashcourse.txt
Last active May 13, 2025 17:55
NPM Crash Course Commands
# GET VERSION
npm -v (or --version)
# GET HELP
npm help
npm
# CREATE PACKAGE.JSON
npm init
npm init -y (or --yes)
@sharmaeklavya2
sharmaeklavya2 / cp_syllabus.md
Last active April 3, 2025 14:59
Competitive Programming Syllabus

Competitive Programming Syllabus

Geometry

  • Problems - Refer the article for a list of problems which can be solved using Rotating Calipers technique.
@CMCDragonkai
CMCDragonkai / history_data_structures.md
Last active February 18, 2025 08:55
History Data Structures

History Data Structures

For stateful applications, there are 5 different ways of managing the history of state:

  • No History - Living in the moment. - Examples: Any stateful application that doesn't discards all previous states upon mutation.
  • Ad Hoc Snapshotting - Allows restoration to manually saved snapshots. - Examples: Memento Pattern.
  • Singleton - Only remembers the previous snapshot, where undoing the undo is just another undo. - Examples: Xerox PARC Bravo.
  • 1 Stack - Allows linear undo. - Examples: AtariWriter.
  • 2 Stack - Allows linear undo and redo. - Examples: Browser History, Microsoft Word, Adobe Photoshop.
@GregKWhite
GregKWhite / diff-so-fancy-setup.markdown
Last active July 15, 2021 00:53
Describes how to set up diff-so-fancy
  • Install diff-so-fancy via their website (or just run npm install -g diff-so-fancy)
  • Add the following to your .gitconfig file:
[core]
  pager = diff-so-fancy | less --tabs=1,5 -R
  • I find that these colors work best with it, but it's up to you if you want to add them to your .gitconfig or not.
[color "diff"]
 meta = "yellow bold"
@vasanthk
vasanthk / System Design.md
Last active May 15, 2025 09:02
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?
@rajarsheem
rajarsheem / littlechecker.py
Last active March 23, 2024 18:18
A little code checker tool in python for Java,C,Cpp. Handles compile error, runtime error, accepted, wrong, TLE.
import os, filecmp
codes = {200:'success',404:'file not found',400:'error',408:'timeout'}
def compile(file,lang):
if lang == 'java':
class_file = file[:-4]+"class"
elif lang == 'c':
class_file = file[:-2]
elif lang=='cpp':

Problems & Solutions for Interaction Between C and Go

At Vimeo, on the transcoding team, we work a lot with Go, and a lot with C, for various tasks such as media ingest. This means we use CGO quite extensively, and consequently, have run into bits that are perhaps not very well documented, if at all. Below is my effort to document some of the problems we've run into, and how we fixed or worked around them.

Many of these are obviously wrong in retrospect, but hindsight is 20/20, and these problems do exist in many codebases currently.

Some are definitely ugly, and I much welcome better solutions! Tweet me at @daemon404 if you have any, or have your own CGO story/tips, please! I'd love to learn of them.

Table of Contents

@unbracketed
unbracketed / branch-fu.md
Created April 7, 2015 17:49
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
@tsolar
tsolar / laravel-subdirectory.conf
Last active February 5, 2025 05:29
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;