Skip to content

Instantly share code, notes, and snippets.

View sshaplygin's full-sized avatar
🎯
Focusing

Semen Shaplygin sshaplygin

🎯
Focusing
  • Belgrade, Republic of Serbia
  • 21:32 (UTC +02:00)
  • X @sshaplygin
View GitHub Profile
@sshaplygin
sshaplygin / comments.py
Last active April 27, 2019 11:47
add symbol "*" to full file program
#!/usr/bin/python3
import os
if name == 'main':
print('Start append')
currentDir = os.getcwd()
addSymbol = '*'
fileNames = os.listdir(currentDir)
docs = list(filter(lambda x: not x.endswith('.py'), fileNames))
@sshaplygin
sshaplygin / getFileName.js
Last active January 18, 2019 11:19
load files from directory and subdirectiry in nodejs
module.exports = (filePath) => {
const dirPathArr = filePath.split('/');
const targerFile = dirPathArr[dirPathArr.length - 1];
const dotIndex = targerFile.indexOf('.');
return targerFile.slice(0, dotIndex > -1 ? dotIndex : targerFile.length);
}
@sshaplygin
sshaplygin / docker-compose.yml
Created January 6, 2020 22:18
Basic docker-compose file to rethinkDB
version: '3'
services:
rethink:
image: rethinkdb # load latest rethinkDB image
volumes:
- ./rethinkdb_data:/data/rethinkdb_data # volume for load backup or save new data files on mapping
ports:
- 8080:8080 # Listening for administrative HTTP connections on port 8080
- 28015:28015 # Listening for client driver connections on port 28015
- 29015:29015 # Listening for intracluster connections on port 29015
@sshaplygin
sshaplygin / constans.go
Last active April 16, 2020 23:08
Golang max and min math constants with bytes shifts from SOF https://stackoverflow.com/questions/6878590/the-maximum-value-for-an-int-type-in-go
const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1
import requests
query = 'Только не по лицу'
genre = 10
def get_genres():
"""
Функция отправляет запрос к Балабобе,
и получает в ответ список жанров.

1. Name

Last Name = Sidorov First Name = Mitrofan Middle Name - check "No middle name"

2. Gender

Male

3. Birth Date

@sshaplygin
sshaplygin / cv.tex
Last active October 22, 2022 20:27
My CV in LaTex-file online compiler overleaf.com
%-------------------------
% Resume in Latex
% Author : Jake Gutierrez
% Based off of: https://github.com/sb2nov/resume
% License : MIT
%------------------------
\documentclass[letterpaper,11pt]{article}
\usepackage{latexsym}
@sshaplygin
sshaplygin / unpack.go
Last active March 22, 2022 11:04
hw02_unpack_string
package hw02unpackstring
import (
"errors"
"strconv"
"strings"
"unicode"
)
const escapeSymbol string = "\\"
@sshaplygin
sshaplygin / pipeline.go
Last active May 12, 2022 19:06
hw06_pipeline_execution
package hw06pipelineexecution
type (
In = <-chan interface{}
Out = In
Bi = chan interface{}
)
type Stage func(in In) (out Out)
@sshaplygin
sshaplygin / parallel.go
Last active July 18, 2022 12:26
hw_05_parallel_execution
package hw05parallelexecution
import (
"errors"
"sync"
"sync/atomic"
)
var ErrErrorsLimitExceeded = errors.New("errors limit exceeded")