Skip to content

Instantly share code, notes, and snippets.

View alexpts's full-sized avatar
🤘
enjoying

Alex Pavlov alexpts

🤘
enjoying
  • Avito
View GitHub Profile
@alexpts
alexpts / parseIpv4.go
Last active October 11, 2020 05:45
parseIpv4
func parseIpv4(s string) [4]byte {
var ip [4]byte
// первые три байта парсим
for i := 0; i < 3; i++ {
for p := 0; p < 4; p++ {
if s[p] == '.' {
number, _ := strconv.ParseUint(s[:p], 10, 8)
ip[i] = byte(number)
@alexpts
alexpts / configs.yml
Last active October 31, 2021 10:11
gitlab + registry configs
#### Gitlab config - gitlab.rb
# default configs from omnibus + custom options
# Nginx Proxy + SSL
external_url = 'https://gitlab.ex.ru'
# Registry
registry_nginx['enable'] = false # disable gitlab nginx registry proxy
@alexpts
alexpts / rust-http-parser.rs
Created March 24, 2022 04:34
rust-http-parser.rs
use std::collections::HashMap;
struct Message;
#[derive(Debug)]
struct Request<'a> {
body: &'a str,
method: &'a str,
uri: &'a str,
protocol: &'a str,
@alexpts
alexpts / .gitconfig
Created April 23, 2023 17:37
GitConfig Glob Mask
# Базовый ~/.gitconfig, для суб директорий можно подключить свои конфиги, например для личных и рабочик проектов
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
# extend and overwrite config for glob path
[includeIf "gitdir:~/www/**/*"]
path = ~/www/.gitconfig