Skip to content

Instantly share code, notes, and snippets.

View mikolasan's full-sized avatar
🌀
Fractal is almost compiled

Nikolay Neupokoev mikolasan

🌀
Fractal is almost compiled
View GitHub Profile
@mikolasan
mikolasan / nineteen.sh
Last active August 29, 2015 14:14 — forked from bhundven/nineteen.sh
#!/bin/bash
#
# NINETEEN.SH
# This script allows you to install/update Enlightenment 19 git version on
# Ubuntu 14.04 LTS or Debian wheezy/sid, or remove E19 git from your system.
# Originally from: http://ubuntuforums.org/showthread.php?t=2203190
# By: Philippe J. Guillaumie (batden AT sfr DOT fr).
# Additional updates by: Bryan Hundven (bryanhundven AT gmail DOT com).
#
# Tip:
@mikolasan
mikolasan / main.py
Last active July 17, 2017 06:01
Relay control
import curses
from curses import wrapper
import serial
import sys
channels = ['1', '2', '3', '4', '5', '6', '7', '8']
def calc_crc(data):
return sum(data)
@mikolasan
mikolasan / .vimrc
Last active March 14, 2018 05:20
Vim config
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@mikolasan
mikolasan / .emacs
Created January 10, 2018 17:22
Emacs config
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
(add-to-list 'package-archives (cons "melpa" url) t))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/"))
@mikolasan
mikolasan / scrap.py
Created November 14, 2018 04:53
yap scraping
from requests import get
from requests.exceptions import RequestException
from contextlib import closing
from bs4 import BeautifulSoup
from bs4 import Comment
from datetime import datetime
def simple_get(url):
"""
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix csvw: <http://www.w3.org/ns/csvw#>.
@prefix : <http://example.org/data/cat_beeds_list_wikipedia.csv#>.
_:autos1 a csvw:TableGroup;
csvw:table [a csvw:Table ;
csvw:url <http://example.org/data/cat_beeds_list_wikipedia.csv#> ;
csvw:row [a csvw:Row ;
@mikolasan
mikolasan / azathoth_bios_defconfig
Last active February 24, 2019 01:07
[Buildroot] simple config for GRUB2 bootable ISO image
BR2_x86_64=y
BR2_CCACHE=y
BR2_OPTIMIZE_FAST=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_18=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_TARGET_GENERIC_HOSTNAME="azathoth"
BR2_TARGET_GENERIC_ISSUE="The Installer is greeting you"
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_SYSTEM_BIN_SH_ZSH=y
# BR2_TARGET_GENERIC_GETTY is not set
@mikolasan
mikolasan / main.py
Created May 14, 2021 14:00
Python simple systemd service
#!/usr/bin/env python3
from time import sleep
from threading import Thread
def do_the_thing():
n = 0
while True:
if n % 5 == 0:
@mikolasan
mikolasan / README.md
Last active August 31, 2021 04:00
WS8215 LED strip with Arduino like board (Wemos D1 R1 ESP8266 ESP-12F)

WS8215 with Wemos D1 R1

Wemos D1 R1 is an Arduino like board that has ESP8266 on board (specifically ESP-12F)

Initial setup (Arduino IDE)

  1. File > Preferences > Additional Boards Manager URLSs: http://arduino.esp8266.com/stable/package_esp8266com_index.json
  2. Tools > Board > Boards Manager. Search for: wemos. esp 8266 by ESP8266 Community. Version 3.0.2. Install
  3. Tools > Board > LOLIN(WeMos) R1 D1
@mikolasan
mikolasan / CMakeLists.txt
Created August 31, 2021 15:38
LED strip animation demo - fading squares like in music light box
cmake_minimum_required(VERSION 3.11)
project(led LANGUAGES CXX C)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(test light-squares.cpp)
target_include_directories(test PRIVATE thirdparty/include)
target_link_directories(test PRIVATE thirdparty/lib)