Skip to content

Instantly share code, notes, and snippets.

View nvbn's full-sized avatar

Vladimir Iakovlev nvbn

View GitHub Profile
@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 / lines
Created January 27, 2020 16:37
test.v2 0 1580115600
test.v2 0 1580115660
test.v2 1 1580115720
test.v2 3 1580115780
test.v2 2 1580115840
test.v2 2 1580115900
test.v2 10 1580115960
test.v2 10 1580116020
test.v2 12 1580116080
test.v2 0 1580116140
@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
@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 / 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 / add_ngrams.py
Last active January 8, 2019 08:21
Extracting popular topics from subreddits
from datetime import datetime
import json
from functools import lru_cache
from multiprocessing import Pool
import sys
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk.corpus import stopwords
from nltk.util import ngrams
from nltk import WordNetLemmatizer, pos_tag
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 / classify_image.py
Created November 21, 2018 00:15
SA trip analysis
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@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