Skip to content

Instantly share code, notes, and snippets.

View ranuzz's full-sized avatar
🏗️
Building Stuff

Shekhar Chandra ranuzz

🏗️
Building Stuff
View GitHub Profile
@ranuzz
ranuzz / coincap_cryptotracker.py
Created December 4, 2021 03:31
crypto tracker that rings a bell when desired change has happened in price
"""
crypto tracker that rings a bell when desired change has happened in price
using coincap.io
spported assets: bitcoin, ethereum and more
"""
import http.client
import json
import sys
import time
@ranuzz
ranuzz / artificial_ant_deap_pygame.py
Created July 20, 2021 20:20
Visualising Artificial Ant problem solution written in DEAP using pygame
# This file is part of DEAP.
#
# DEAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# DEAP is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ranuzz
ranuzz / conway_gol_pwp.py
Created June 9, 2021 02:29
Conway's Game of Life in Processing with Python
"""
https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
conway's game of life
"""
from random import randint
def gameOfLife(grid):
state = {}
rows = len(grid)
@ranuzz
ranuzz / sort_viz_pwp.py
Created June 8, 2021 08:07
Sorting Visualization using Processing with Python mode
"""
Sorting visualization
"""
from random import randint
def setup():
size(1080/2, 1920/2)
frameRate(2)
@ranuzz
ranuzz / pwp.py
Created June 7, 2021 20:22
Little bit of an experiment using Python mode for Processing.
"""
Processing with Python !
"""
def setup():
size(1080/2, 1920/2)
def draw():
background(255)
fill(0)
@ranuzz
ranuzz / latency.txt
Created October 4, 2020 14:38 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@ranuzz
ranuzz / .screenrc
Created November 18, 2019 10:16 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off