Skip to content

Instantly share code, notes, and snippets.

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

Andrii Soldatenko andriisoldatenko

🏠
Working from home
View GitHub Profile
@andriisoldatenko
andriisoldatenko / interesting_twitter_golang.md
Last active September 24, 2023 20:24
Interesting twitter accounts to follow about go (goalng)

Interesting twitter accounts to follow about Go programming language

Made with ❤️and golang tools 🛠 by @a_soldatenko

People

Interesting bloggers in twitter

  • @rob_pike - Rob Pike author of Go programming language.
  • @francesc - Francesc Campoy is Gopher, Developer Advocate, Good Guy.
@andriisoldatenko
andriisoldatenko / collocations_example.py
Created September 3, 2016 07:38
Collocations example
import pprint
from nltk.corpus import stopwords
from nltk.corpus import webtext
from nltk.collocations import BigramCollocationFinder
from nltk.metrics import BigramAssocMeasures
stopset = set(stopwords.words('english'))
filter_stops = lambda w: len(w) < 3 or w in stopset
words = [w.lower() for w in webtext.words('grail.txt')]

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@andriisoldatenko
andriisoldatenko / commit-msg
Created June 27, 2018 08:04
Pre commit hook to check git branch prefix to include Jira ticket
#!/usr/bin/env ruby
# consumeraffairs/.git/hooks/commit-msg
# Finds the story number from the branch name and injects it
# into the commit message. For instance, if we're on branch
#
# BRAND-1234-Some-Feature
#
# And we had committed with
#
# git commit -m "I did some feature"
@andriisoldatenko
andriisoldatenko / install_python.sh
Last active May 14, 2020 05:43
Install local Python 2.7.10 on CentOS 7
TMP_PATH=~/tmp_install_python
# Versions section
PYTHON_MAJOR=2.7
PYTHON_VERSION=$PYTHON_MAJOR.10
mkdir $TMP_PATH && cd $TMP_PATH
# Update yum and libraries
yum -y update
{
"kind": "youtube#videoListResponse",
"etag": "\"8jEFfXBrqiSrcF6Ee7MQuz8XuAM/CCMKJ4Yog67Jfq11ExS2XxNDDQ0\"",
"pageInfo": {
"totalResults": 28,
"resultsPerPage": 28
},
"items": [
{
"kind": "youtube#video",
FROM golang AS builder
WORKDIR /src
RUN go get -u github.com/go-delve/delve/cmd/dlv
ADD . /src
RUN cd /src && go build -o goapp
FROM alpine
WORKDIR /app
COPY --from=builder /src/goapp /app/
ENTRYPOINT ./goapp
@andriisoldatenko
andriisoldatenko / windows.md
Last active April 17, 2019 14:51
Run Astronomer CLI on Windows

Run Astronomer CLI on Windows

Make sure you have Windows 10 and Docker installed

  1. Download latest release of astro-cli using this link
  2. Extract astro_0.8.2_windows_386.zip and move astro.exe somewhere in your %PATH%
  3. Open cmd or PowerShell console and run:
C:\Windows\system32>astro version
Astro CLI Version: 0.8.2
Git Commit: f5cdab8f832da3c6184a7ac167b491e3bac3c022
@andriisoldatenko
andriisoldatenko / fopen.py
Last active November 20, 2018 05:42
This function helps you do not see errors during upload solutions, because you forget to switch back to sys.stdin and also you can easily debug your code with ipdb or another python debuggers
def fopen(filename, default=sys.stdin):
"""
This function helps you do not see errors during upload solutions
because you forget to switch back to sys.stdin and also you can easily
debug your code with ipdb or another python debuggers
"""
try:
f = open(filename)
except FileNotFoundError:
f = default
@andriisoldatenko
andriisoldatenko / latency.txt
Last active February 18, 2018 07:16 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD