Skip to content

Instantly share code, notes, and snippets.

View nvbn's full-sized avatar

Vladimir Iakovlev nvbn

View GitHub Profile
@nvbn
nvbn / App.js
Last active August 29, 2023 13:39
Hooks with classes
import React from "react";
import Counter from "./Counter";
const App = () => {
return (
<div className="App">
<Counter initialCount={100} />
</div>
);
};
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nvbn
nvbn / app.py
Last active March 11, 2023 13:16
Sound lights with spotify, esp8266 and neopixel strip
from __future__ import annotations
import array
import asyncio
from bisect import bisect_left
from dataclasses import dataclass
import logging
import os
import socket
import time
import pyparsing as pp
token = pp.Word(pp.alphanums + '_-.')
command = pp.OneOrMore(token)
separators = ['1>>', '2>>', '>>', '1>', '2>', '>', '<', '||',
'|', '&&', '&', ';']
separator = pp.oneOf(separators)
import json
from datetime import datetime
from collections import namedtuple
from itertools import groupby, takewhile
from statistics import median, mean
from matplotlib import pyplot
import numpy as np
from geopy.distance import geodesic
Point = namedtuple('Point', 'latitude, longitude, datetime')
@nvbn
nvbn / p16.rs
Last active December 16, 2021 23:04
use crate::utils::{read_input, Result};
#[derive(Clone, Copy)]
pub enum OperatorType {
Sum,
Product,
Min,
Max,
Gt,
Lt,
@nvbn
nvbn / playlist.ipynb
Last active November 15, 2021 10:02
Playlist analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nvbn
nvbn / bf_2.clj
Last active June 19, 2021 12:29
bf_2.clj
(ns bf.core)
(defmulti run-symbol
(fn [symbol _] symbol))
(defmethod run-symbol \+
[_ {:keys [pos] :as state}]
(update-in state [:stack pos] inc))
(defmethod run-symbol \-
from datetime import datetime
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from nltk.sentiment.vader import SentimentIntensityAnalyzer
import praw
options = dict(client_id='',
client_secret='',
user_agent='')
@nvbn
nvbn / generate.py
Created August 29, 2018 22:33
Bob's Burgers to The Simpsons with TensorFlow
from pathlib import Path
from typing import NamedTuple
from collections import defaultdict
from datetime import timedelta
from subprocess import call
from pycaption.srt import SRTReader
import lxml.html
import tensorflow as tf
import tensorflow_hub as hub
import numpy as np