Skip to content

Instantly share code, notes, and snippets.

View onlinejudge95's full-sized avatar
Those who say programming is no art, don't know the true meaning of it

onlinejudge95 onlinejudge95

Those who say programming is no art, don't know the true meaning of it
View GitHub Profile
onlinejudge95 /
Last active December 17, 2019 13:06
Hello world in flask
from flask import Flask
app = Flask(__name__)
def hello():
return "Hello World!"
onlinejudge95 /
Created August 11, 2019 15:06
List of badges i normally use.

Build Status GitHub top language Updates GitHub code size in bytes GitHub issues GitHub pull requests GitHub GitHub last commit

onlinejudge95 /
Created October 17, 2019 20:18 — forked from dabeaz/
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 -
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler:


While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.


References that have been read so far:

onlinejudge95 /
Created November 24, 2019 00:19
Making Flask-SQLAlchemy model subscriptable
class BaseModel(Model):
def __getitem__(self, key):
return self.__dict__[key]
class UserModel(BaseModel):
class AdminModel(BaseModel):
onlinejudge95 /
Created December 12, 2019 06:53
Update your fork

1. Clone your fork 🍴


2. Add upstream as a remote

cd /path/to/fork
git remote add upstream{$UPSTREAM_USER_NAME}/{$UPSTREAM_REPO}.git
git fetch upstream

3. Pulling in upstream changes

git pull upstream master

onlinejudge95 /
Last active February 15, 2020 08:33
Late night gig
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(-2, 2, 0.00001)
upper = np.sqrt(1 - (abs(x) - 1) ** 2)
lower = np.arccos(1 - abs(x)) - np.pi
plt.plot(x, upper, color="darkred")
onlinejudge95 /
Last active November 7, 2020 05:36
Setup your system
----------------Install vim----------------
sudo apt update
sudo apt install --assume-yes vim
----------------Install wget----------------
sudo apt update
sudo apt install --assume-yes wget
----------------Install snap----------------
sudo apt update
onlinejudge95 / settings.json
Created June 6, 2021 10:19
Settings for vscode
"editor.formatOnSave": true,
"editor.tabCompletion": "on",
"editor.tabSize": 2,
"eslint.options": { "configFile": "./config/.eslintrc.yml", "ignorePath": "./config/.eslintignore" },
"files.insertFinalNewline": true,
"prettier.configPath": "./config/.prettierrc.yml",
"prettier.ignorePath": "./config/.prettierignore"
onlinejudge95 /
Last active September 20, 2021 11:29
Installing NGINX from source
apt update
apt upgrade --assume-yes
apt autoremove
apt install --assume-yes build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev
wget install
tar -xvzf nginx-1.21.1.tar.gz