Skip to content

Instantly share code, notes, and snippets.

View Sangarshanan's full-sized avatar
🎮
We live in a society

sangarshanan Sangarshanan

🎮
We live in a society
View GitHub Profile
@Sangarshanan
Sangarshanan / misc
Last active March 6, 2024 07:51
Punctual gist
-- fit 3 $ circle [sin cps, osc 0] [osc 0.5, 0.5] * (osc ft) * 0.2 >> video;
-- fit 3 $ circle [0, sin cps] [osc 0.5, 0.5] * 0.2 >> video;
circle [0.0, 0.0] (osc ft) * 0.3 >> red;
fit 1 $ circle [osc 0.1, 0.0] (osc ft) * 0.3 >> blue;
fit 1 $ circle [0.1, osc 0.1] (osc ft) * 0.3 >> green;
-- mesh [0,0.1] [0.5,0.5] * (osc ft) * 0.2 >> blue;
-- mesh [0,-0.1] [0.5,0.5] * (osc ft) * 0.2 >> video;
@Sangarshanan
Sangarshanan / AbstractSummariser.ipynb
Last active April 22, 2024 14:04
Summarise Abstracts from Proposals
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// A Lonely Spaceship Travelling the Expanse of the Universe
function setup() {
// A Nice Canvas to Draw
createCanvas(350, 600);
}
function SpaceBackground() {
// Space is Dark
background(0, 0, 0);
"""
Folium choloropeth with suport for Branca colormaps and custom feature functions
"""
import folium
import warnings
import numpy as np
from folium.map import FeatureGroup
from branca.utilities import color_brewer
from branca.colormap import ColorMap, StepColormap, LinearColormap
"""Count Min Hash."""
from hashlib import md5, sha1, blake2b, sha3_512
def get_row_column(value, hash_fns, m):
"""Fetch Row and Column."""
for row, _hash_fn in enumerate(hash_fns):
column = (
int(
"""Hyper Log Log."""
import math
from hashlib import sha1
class HyperLogLog(object):
"""HyperLogLog."""
def __init__(self, k):
"""Initialize Bucket Size."""
self.k = k
"""Basic Proxies in Python."""
"""Twisted."""
from twisted.internet import reactor
from twisted.web import proxy, server
site = server.Site(proxy.ReverseProxyResource("example.com", 80, b""))
reactor.listenTCP(8080, site)
reactor.run()
"""Huffman Puffman.
Visualize the Tree on https://github.com/Sangarshanan/huffman-coding
"""
import heapq
from collections import Counter
def encode_message(message):
"""
Convert the String to a Fixed 8 bit binary
ord(character) -> Unicode -> 08b binary
@Sangarshanan
Sangarshanan / logistic_map.ipynb
Created December 21, 2020 08:26
Chaos Theory and the Logistic Map
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""Bloom: Studio album by Troye Sivan."""
import pyhash
def calculate_hash(value, m):
# FNV
hash1 = pyhash.fnv1_32()(value) % m
# MurMur
hash2 = pyhash.murmur1_32()(value) % m