Skip to content

Instantly share code, notes, and snippets.

View talaikis's full-sized avatar

Tadas Talaikis talaikis

View GitHub Profile
View base64-to-image.js
import { saveAs } from 'file-saver'
const base64Data = ''
const imgBuff = Buffer.from(base64Data.replace(/^data:image\/\w+;base64,/, ''), 'base64')
const blob = new Blob([new Uint8Array(imgBuff).buffer])
saveAs(blob)
View stream-queue.js
const child = require('child_process')
const { cpus } = require('os')
const transform = require('stream-transform')
class Pool {
constructor (file, maxPool, done) {
this.pool = []
this.active = []
this.waiting = []
this.maxPool = maxPool
View builoder.js
const { join } = require('path')
const { writeFile, unlink } = require('fs')
const functions = [
{ p: join(__dirname, 'handlers', 'user', 'confirm', 'index.js'), o: join(__dirname, 'build', 'userConfirm.js') },
{ p: join(__dirname, 'handlers', 'user', 'delete', 'index.js'), o: join(__dirname, 'build', 'userDelete.js') },
{ p: join(__dirname, 'handlers', 'user', 'edit', 'index.js'), o: join(__dirname, 'build', 'userEdit.js') },
{ p: join(__dirname, 'handlers', 'user', 'get', 'index.js'), o: join(__dirname, 'build', 'userGet.js') },
{ p: join(__dirname, 'handlers', 'user', 'signin', 'index.js'), o: join(__dirname, 'build', 'signin.js') },
{ p: join(__dirname, 'handlers', 'user', 'signup', 'index.js'), o: join(__dirname, 'build', 'signup.js') },
View Billionaires.csv
Industry Number % of total
Finance and Investments 310 14%
Fashion and Retail 235 11%
Real Estate 220 10%
Manufacturing 207 9%
Technology 205 9%
Diversified 194 9%
Food and Beverage 165 7%
Healthcare 134 6%
Energy 94 4%
@talaikis
talaikis / ptv.py
Last active September 25, 2017 19:26
Probabilistic true value
View ptv.py
"""
This idea first used for bitcoin. Data file format is MT4's.
Similar strategy(-ies) is used by market makers.
It's definitely betetr than any moving average based strategy.
ETH donations accepted: 0x007F11363140F2edE5f6d4F1a19A352861e013e0
"""
from os.path import join
from pandas import read_csv, to_datetime, DataFrame, read_pickle
@talaikis
talaikis / sniff.py
Created June 10, 2017 10:12
Recycle bin sniffer for Windows
View sniff.py
"""
Recycle bin sniffer for Windows.
Tested on Python 3.6, Windows 8.1.
"""
from os import listdir
from os.path import isdir
import optparse
from winreg import (OpenKey, QueryValueEx)
from shutil import move
@talaikis
talaikis / ml.py
Created June 10, 2017 06:36
Machine learning algorithms comparison for 1 feature
View ml.py
from os.path import dirname, join
from numpy import where, shape
from pandas import read_csv
from sklearn.metrics import accuracy_score
from sklearn.cluster import DBSCAN, MiniBatchKMeans, SpectralClustering, KMeans
from sklearn.decomposition import FastICA, PCA, NMF
from sklearn.linear_model import LogisticRegression, RidgeClassifier
from sklearn.ensemble import GradientBoostingClassifier, BaggingClassifier, RandomForestClassifier, VotingClassifier, AdaBoostClassifier
from sklearn.preprocessing import PolynomialFeatures, scale