Skip to content

Instantly share code, notes, and snippets.

Avatar

Vladimir Iakovlev nvbn

View GitHub Profile
@nvbn
nvbn / fimstrip.py
Last active Jun 20, 2018
fimstrip.py
View fimstrip.py
from collections import Counter
import requests
from pycaption.srt import SRTReader
import lxml.html
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
lang = 'en-US'
path = ''
View commute.py
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 / wrapper.go
Created Feb 25, 2018
Low-level shell wrapper package
View wrapper.go
package wrapper
import (
"os/exec"
"os"
"sync"
"github.com/kr/pty"
"github.com/creack/termios/raw"
"github.com/creack/termios/win"
"io"
View macbook_touchbar_christmas_lights.js
const { app, BrowserWindow, TouchBar } = require('electron');
const { TouchBarLabel, TouchBarButton } = TouchBar;
const count = 8;
const interval = 500;
const colors = [
'#ff0000',
'#00ff00',
'#0000ff',
'#ffff00',
View WebViewWrapperManager.java
// android/app/src/main/java/com/YOUR_APP/webview/WebViewWrapperManager.java
package com.YOUR_APP.webview;
import android.webkit.WebView;
import com.facebook.react.views.webview.ReactWebViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
public class WebViewWrapperManager extends ReactWebViewManager {
private static final String REACT_CLASS = "RCTWebViewWrapper";
@nvbn
nvbn / main.py
Last active Dec 5, 2017
flights graph
View main.py
from collections import Counter
import tweepy
import networkx
from matplotlib import cm, pyplot
TWITTER_CONSUMER_KEY = ''
TWITTER_CONSUMER_SECRET = ''
TWITTER_ACCESS_TOKEN = ''
TWITTER_ACCESS_TOKEN_SECRET = ''
View complexity.py
from abc import ABC, abstractmethod
from typing import List, NamedTuple, Iterable, Any, TypeVar, Generic, Callable
import matplotlib.pyplot as plt
from line_profiler import LineProfiler
ComplexityLogEntry = NamedTuple('ComplexityLogEntry', [('size', int),
('hits', int)])
class BaseComplexityAssumption(ABC):
@nvbn
nvbn / out.py
Last active May 1, 2017
py-backwards result
View out.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def _py_backwards_merge_dicts(dicts):
result = {}
for dict_ in dicts:
result.update(dict_)
View validator.cpp
#include <iostream>
#include <sstream>
#include <regex>
using namespace std;
class Validator {
public:
Validator(istream &in) : in_(in) {}
@nvbn
nvbn / complexity.py
Created Mar 17, 2017
Primitive complexity analyzer
View complexity.py
from collections import namedtuple
import timeit
import matplotlib.pyplot as plt
ComplexityLogEntry = namedtuple('ComplexityLogEntry', ('size', 'time'))
class BaseComplexityAssumption(object):
title = ''
You can’t perform that action at this time.