Skip to content

Instantly share code, notes, and snippets.


Shital Shah sytelus

View GitHub Profile
cwillmor / ells.pde
Created Jan 25, 2021
ells.pde (L-tiling clock in processing)
View ells.pde
// ell clock
// developed with processing 3.5.4 (
// TODO:
// - motion blur
// - ripple update of ells - one only starts rotating when it has room to (<< ... <> ... >>)
static final int DEPTH = 3;
static final int N = 1 << (DEPTH + 1);
static final int FRAME_RATE = 30;
static final float DT = 1 / (float)FRAME_RATE;
tamuhey /
Last active Jun 26, 2022
How to calculate the alignment between BERT and spaCy tokens effectively and robustly

How to calculate the alignment between BERT and spaCy tokens effectively and robustly



Natural Language Processing (NLP) has made great progress in recent years because of neural networks, which allows us to solve various tasks with end-to-end architecture. However, many NLP systems still require language-specific pre- and post-processing, especially in tokenizations. In this article, I describe an algorithm that simplifies calculating correspondence between tokens (e.g. BERT vs. spaCy), one such process. And I introduce Python and Rust libraries that implement this algorithm. Here are the library and the demo site links:


Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?

thomwolf /
Last active Apr 21, 2022
A very small and self-contained gist to train a GPT-2 transformer model on wikitext-103
# Copyright (c) 2019-present, Thomas Wolf.
# All rights reserved. This source code is licensed under the MIT-style license.
""" A very small and self-contained gist to train a GPT-2 transformer model on wikitext-103 """
import os
from collections import namedtuple
from tqdm import tqdm
import torch
import torch.nn as nn
from import DataLoader
from ignite.engine import Engine, Events
rxwei /
Last active Nov 4, 2019
First-Class Automatic Differentiation in Swift: A Manifesto
soumith / gist:01da3874bf014d8a8c53406c2b95d56b
Last active Mar 28, 2022
Install PillowSIMD+libjpeg-turbo on Conda
View gist:01da3874bf014d8a8c53406c2b95d56b
conda uninstall --force pillow -y
# install libjpeg-turbo to $HOME/turbojpeg
git clone
pushd libjpeg-turbo
mkdir build
cd build
make install
ctmakro /
Last active Apr 12, 2022
Display numpy ndarray as Image in Jupyter/IPython notebook
# if input image is in range 0..1, please first multiply img by 255
# assume image is ndarray of shape [height, width, channels] where channels can be 1, 3 or 4
def imshow(img):
import cv2
import IPython
_,ret = cv2.imencode('.jpg', img)
i = IPython.display.Image(data=ret)

Setting up Conky on Ubuntu 16.04LTS for the Clevo P751DM2-G

System Information:

We extract this with inxi:


sudo apt-get install inxi
terabyte /
Created Dec 6, 2017
Amazon's Build System


I wrote this answer on stackexchange, here:

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

wassname /
Created Sep 27, 2017
Live plot using %matplotlib notebook in jupyter notebook
import numpy as np
from matplotlib import pyplot as plt
class LivePlotNotebook(object):
Live plot using %matplotlib notebook in jupyter notebook
import time