Skip to content

Instantly share code, notes, and snippets.

View stavinsky's full-sized avatar

Anton Stavinsky stavinsky

View GitHub Profile
@stavinsky
stavinsky / utils.py
Created January 23, 2017 16:36
Python sklearn pipline helpers
from sklearn.base import TransformerMixin
class TransformWrapper(TransformerMixin):
"""simple wrapper for instruments like LabelEncoder.
It is usefull if we want to encode many features at one time.
They have a little bit different interface compairing to OneHotEncoder for example"""
def __init__(self, enc):
self.enc = enc
@stavinsky
stavinsky / 0_reuse_code.js
Created March 28, 2017 18:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@stavinsky
stavinsky / README.MD
Created June 15, 2017 09:44
s6d1121 stm32 hal opensmart

This is a test for my lcd display.

PINS DB7:0 connected to A7:0

Other pins connected as described in lcd.h

@stavinsky
stavinsky / rtc.c
Created June 15, 2017 09:48
ds1302 stm32 hal
/*
* rtc.c
*
* Created on: 11 июн. 2017 г.
* Author: stavinsky
*/
#include "rtc.h"
@stavinsky
stavinsky / readme.md
Last active June 15, 2017 09:53
utils

add got_chars((char *)Buf, Len); to int8_t CDC_Receive_FS (uint8_t Buf, uint32_t *Len)

and add usb_out(); to main loop

@stavinsky
stavinsky / ngram.py
Created April 9, 2018 12:46
simple ngram for russian texts
import re
class NGram():
pattern = re.compile('[^а-яА-Я ]+')
_ngrams = dict()
_it = 0
def __init__(self):
self.words = dict()
self._it = 0
@stavinsky
stavinsky / ad4351.py
Last active December 23, 2024 10:29
adf4351 controlled by ftdi chip
import argparse
import struct
from pyftdi.ftdi import Ftdi
from math import log2
from pyftdi.spi import SpiController
def calculate_adf4351_registers(
f_out,
f_ref,