Skip to content

Instantly share code, notes, and snippets.

View nvbn's full-sized avatar

Vladimir Iakovlev nvbn

View GitHub Profile
@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 / find.py
Created July 9, 2018 22:23
trip planner
import json
from datetime import date, datetime, timedelta
from collections import defaultdict, namedtuple
from multiprocessing import Pool, cpu_count
import csv
from operator import itemgetter
from heapq import merge
from itertools import islice
from dateutil.parser import parse
@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
@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 / fimstrip.py
Last active June 20, 2018 07:14
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 = ''
const { app, BrowserWindow, TouchBar } = require('electron');
const { TouchBarLabel, TouchBarButton } = TouchBar;
const count = 8;
const interval = 500;
const colors = [
'#ff0000',
'#00ff00',
'#0000ff',
'#ffff00',
@nvbn
nvbn / wrapper.go
Created February 25, 2018 09:23
Low-level shell wrapper package
package wrapper
import (
"os/exec"
"os"
"sync"
"github.com/kr/pty"
"github.com/creack/termios/raw"
"github.com/creack/termios/win"
"io"
@nvbn
nvbn / main.py
Last active December 5, 2017 07:48
flights graph
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 = ''
// 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 / core.cljs
Created June 28, 2015 14:54
vr with cljs
(ns vr-cljs.core)
(enable-console-print!)
(defn get-camera
"Creates camera with desired aspect ratio."
[]
(doto (js/THREE.PerspectiveCamera. 75 (/ (.-innerWidth js/window)
(.-innerHeight js/window))
0.1 1000)