Skip to content

Instantly share code, notes, and snippets.

View satyajeetkrjha's full-sized avatar
💭
Curious

Satyajeet Kumar Jha satyajeetkrjha

💭
Curious
  • New York ,USA
View GitHub Profile
@satyajeetkrjha
satyajeetkrjha / card.cpp
Created June 5, 2022 01:14 — forked from michaelsafyan/card.cpp
C++ Playing Cards
#include "card.h"
#include <sstream>
namespace playing_cards {
Card::Card(int value, Suit suit) : value_(value), suit_(suit) {}
Card::Card(const Card& o) : value_(o.value_), suit_(o.suit_) {}
Card::~Card() {}

C++ OOPS Concepts

The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.

Characteristics of an Object Oriented Programming language

img

@dabeaz
dabeaz / aproducer.py
Created October 17, 2019 17:46
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 - https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# aproducer.py
#
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler:
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active October 28, 2025 23:59
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

import * as Sentry from "@sentry/node";
import imagemin from "imagemin";
import mozjpeg from "imagemin-mozjpeg";
import sharp from "sharp";
import isJpg from "is-jpg";
import * as aws from "aws-sdk";
import { Upload } from "../../types/graphqlUtils";
import { generateFilename } from "./generateFilename";
export const s3 = new aws.S3({
@bradtraversy
bradtraversy / docker-help.md
Last active October 29, 2025 05:12
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@zhouchangxun
zhouchangxun / loadbalancer.py
Created July 5, 2018 08:06
a simple loadbalancer implemention with python.
import sys
import socket
import select
import random
from itertools import cycle
# dumb netcat server, short tcp connection
# $ ~ while true ; do nc -l 8888 < server1.html; done
# $ ~ while true ; do nc -l 9999 < server2.html; done
SERVER_POOL = [('10.157.0.238', 8888)]
@hsiuhsiu
hsiuhsiu / fft.cpp
Last active April 18, 2024 23:08
[FFT] Fast Fourier Transform in c++ and basic applications #Algorithm #ACM
#include <complex>
#include <iostream>
#include <valarray>
#include <vector>
using namespace std;
const double PI = 3.141592653589793238460;
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
const sendgrid = require('sendgrid');
const helper = sendgrid.mail;
const keys = require('../config/keys');
class Mailer extends helper.Mail {
constructor({ subject, recipients }, content) {
super();
this.sgApi = sendgrid(keys.sendGridKey);
this.from_email = new helper.Email('no-reply@emaily.com');
@VirajKanse
VirajKanse / gist:1c0db872cd7685632c02f8826397f190
Last active January 6, 2025 09:57
GCC / Clang C/C++ Compiler On Android Using Termux (Linux Environment)
Install Termux App.
type "apt update"
Then We have to install a text editor to write our code so type "apt install vim" for vim text editor
or u can also use nano text editor for nano type "apt install nano"
Now Clang Installation type "apt install clang" and wait for download completes.
now to create a file simply type vim filename.c or .cpp or nano filename.c or cpp
then u will able to write ur code .
write.....to save ur code simply press esc then type ":wq"
now code is ready to compile
type "clang filename.c -o filename"