Skip to content

Instantly share code, notes, and snippets.

danoneata /
Created Jun 7, 2022
JSON decoder in Python
from main import *
class Measurment:
temp: float
humidity: float
# date: datetime
View .tmux.conf
# Remap prefix to C-q.
set -g prefix C-q
unbind C-b
bind C-q send-prefix
# Use C-q C-q to go back to the last window.
bind-key C-q last-window
# Faster command sequences.
set -s escape-time 0
danoneata /
Created Jun 21, 2019
Unix shell intro


  • shell takes commands and passes to the operating system
  • most popular shell is bash (Bourne Again Shell): a replacement of sh, the origianl Unix shell, which was written by Steve Bourne
  • motivating examples:
# Copies all HTML files to `destination`,
# but only those that do not exist or are newer
cp -u *.html destination
danoneata /
Created May 10, 2019
Resources on how to give a talk
  • Kristen Grauman – Tips for Preparing a Clear Talk slides video
  • Patrick Winston – How to Speak videos; see, especially, The Big Four
  • Ranjit Jhala – (An Opinionated Talk) On Preparing Good Talks slides video
  • Gary Bernhardt – How to Prepare a Talk article
  • Iain Murray – Speaking Resources notes
danoneata /
Last active Mar 15, 2019
Model-agnostic meta learning
"""This code is inspired by the homework 2 from CSC421/2516 Winter 2019,
but I'm taking a more functional approach.
import autograd.numpy as np
import autograd as ag
danoneata /
Last active May 5, 2020
Plot a 2D Gaussian
import numpy as np
import pdb
from matplotlib import pyplot as plt
from scipy.stats import multivariate_normal
def gauss2d(mu, sigma, to_plot=False):
w, h = 100, 100
std = [np.sqrt(sigma[0, 0]), np.sqrt(sigma[1, 1])]
danoneata / IOAction.hs
Last active Oct 19, 2018
Toying with free monads
View IOAction.hs
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE LambdaCase #-}
-- This script is based on Chris Taylor's gist:
-- The main differences are:
-- 1. An interpretation in a different monad, the RWS monad. This idea was also was taken from somewhere else:
-- 2. An implementation based on free monads, see the `IOActionFreeMonad.hs` file.
danoneata /
Last active Jul 31, 2018
Monoids – Bucharest FP #31

Definition (monoid). A monoid consists of:

  1. a set M
  2. a binary operation · : M × M → M
  3. an element e ∈ M

such that

  1. the binary operation is associative, that is, x · (y · z) = (x · y) · z, ∀ x, y, z ∈ M
  2. the element e is identity: x · e = x = e · x, ∀ x ∈ M.
danoneata /
Created Apr 21, 2018
Time series classification for gesture recognition
import argparse
import pdb
import os
import sys
from collections import namedtuple
import numpy as np
import pandas as pd
danoneata /
Last active Apr 2, 2018
Python implemetation of Origami patterns
from functools import singledispatch
class Document:
class Paragraph(Document):
def __init__(self, text):
self.text = text