Skip to content

Instantly share code, notes, and snippets.

View eSlider's full-sized avatar
🏠
Working from home

Andriy Oblivantsev eSlider

🏠
Working from home
View GitHub Profile
@eSlider
eSlider / Workflow-Example.md
Last active December 9, 2022 14:56
Workflow-Example

Service for Author and Reader Workflows

This AWS Lambda service provides a streamlined workflow for authors and readers to interact with each other. It allows authors to sign up, configure their reader magnet, and integrate their email tool. It also allows readers to access the author's book landing page, confirm their email address, and access the exclusive content.

Author Workflow

  1. Author Sign-up: Authors come to the website to sign-up for the service and to configure/administer their reader magnet. The author account sign-up flow should simply be email and password. Admin has the ability to approve/reject/freeze accounts in order to save capacity for the 100 authors (in case a bunch of random people sign-up).

  2. Author’s Book Landing Page Configuration: After an author is signed up, they have a landing page configuration capability that provides the inputs to their landing page that readers see for each of their books that contain an email magnet. Each book landing page should have the ability

@eSlider
eSlider / oai
Created December 8, 2022 03:42
OpenAI Chat CLI
#!/bin/bash
## Install
# apt-get install -y jq
## Create an key here: https://beta.openai.com/account/api-keys
export OPENAI_API_KEY='sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
## AI Model
model=text-davinci-003
@eSlider
eSlider / restart-bluetooth.sh
Created November 11, 2022 09:35
Restart bluetooth to get HQ sound over pipewire
#!/bin/bash
# Restart bluetooth on to get HQ devices runs over APTX on pipewire
# Supported devices: IdeaPad 5 Pro 16ACH6 with AX210
# Solutions: https://bbs.archlinux.org/viewtopic.php?id=17135
systemctl stop bluetooth
hciconfig hci0 down
rmmod btusb
modprobe btusb
hciconfig hci0 up
@eSlider
eSlider / semiver.sh
Created July 14, 2021 15:30
semiver.sh
#!/bin/bash
# https://engineering.taboola.com/calculating-git-version/
# Maybe we would use https://gist.github.com/OleksandrKucherenko/9fb14f81a29b46886ccd63b774c5959f
# Depends on https://semver.org/spec/v2.0.0.html
branch=$(git rev-parse --abbrev-ref HEAD)
latest=$(git tag -l --merged master --sort='-*authordate' | head -n1)
semver_parts=(${latest//./ })
major=${semver_parts[0]}
minor=${semver_parts[1]}
@eSlider
eSlider / get-locaiton-translations-by-wiki-id.sh
Last active April 21, 2021 07:14
Get location translations by Wiki ID
#!/bin/sh
WikiID=$(test -z $1 && echo "Q2090" || echo $1)
curl -X GET "https://www.wikidata.org/w/api.php?action=wbgetentities&ids=${WikiID}&format=json" | jq ".entities[].labels | map( {(.language): .value} )"
@eSlider
eSlider / text2speech.sh
Last active October 20, 2023 09:15
Russian text to speech
#!/bin/bash
sudo add-apt-repository ppa:linvinus/rhvoice
sudo apt-get update
sudo apt-get install rhvoice rhvoice-russian rhvoice-english aplay
set -x
# Play russian speaker voices
for speeker in aleksandr irina elena anna
@eSlider
eSlider / Dockerfile
Created April 16, 2021 09:32
Build, make ready to run and dramatically shrink .net 5.0 lambda docker image size by using alpine
#FROM public.ecr.aws/lambda/dotnet:5.0
#
#WORKDIR /var/task
#
## This COPY command copies the .NET Lambda project's build artifacts from the host machine into the image.
## The source of the COPY should match where the .NET Lambda project publishes its build artifacts. If the Lambda function is being built
## with the AWS .NET Lambda Tooling, the `--docker-host-build-output-dir` switch controls where the .NET Lambda project
## will be built. The .NET Lambda project templates default to having `--docker-host-build-output-dir`
## set in the aws-lambda-tools-defaults.json file to "bin/Release/net5.0/linux-x64/publish".
##
package main
import (
"fmt"
"sort"
)
type Person struct {
Name string
Age int
@eSlider
eSlider / remove-duplicates.sh
Created May 2, 2020 15:10
Remote duplicates
#!/bin/bash
fdupes -rSdNI ./
@eSlider
eSlider / go-shell-script.go
Created February 27, 2020 13:19
Golang Shell Script
//usr/bin/env test -x $0 && (go build -o "${0}c" "$0" && "${0}c" $@; r=$?; rm -f "${0}c"; exit "$r"); exit "$?"
//
// The top "comment" defines shebang
// More over:
// * https://gist.github.com/posener/73ffd326d88483df6b1cb66e8ed1e0bd
// * https://getstream.io/blog/switched-python-go/
package main
import (