Skip to content

Instantly share code, notes, and snippets.

View akolybelnikov's full-sized avatar
:octocat:
Building the future, one line of code at a time. 🚀

reddree akolybelnikov

:octocat:
Building the future, one line of code at a time. 🚀
View GitHub Profile
@phortuin
phortuin / signing-git-commits.md
Last active November 16, 2024 07:44
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@lmammino
lmammino / neighbours.rs
Created September 2, 2021 08:13
relative neighbour pixels in generic multidimensional spaces using const generics
fn neighbour_at<const D: usize>(i: u32) -> [i32; D] {
let mut el = [0_i32; D];
let mut n = i;
for v in el.iter_mut().rev() {
*v = (n as i32 % 3) - 1; // -1 is needed because we offset the digits so that we are in range -1..1
n /= 3;
}
el
@maratori
maratori / .golangci.yml
Last active November 19, 2024 16:14
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.62.0
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@soerenmartius
soerenmartius / module.ts
Last active October 12, 2023 09:30
vuex 4 cognito module
import {
ActionContext,
ActionTree,
GetterTree,
MutationTree,
Module,
Store as VuexStore,
CommitOptions,
DispatchOptions,
} from 'vuex'
@seblegall
seblegall / reverseproxy.go
Last active November 10, 2024 08:08
A reverse proxy in Golang using Gin
package main
import (
"fmt"
"net/http"
"net/http/httputil"
"net/url"
"github.com/gin-gonic/gin"
)
@LukeMathWalker
LukeMathWalker / audit.yml
Last active November 11, 2024 17:20
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
@pvsune
pvsune / concurrent.kafka.consumer.py
Last active November 2, 2024 03:08
A multiprocess multithreaded Kafka consumer
#!/usr/bin/env python
import logging
import os
import threading
import time
from multiprocessing import Process
from queue import Queue
from confluent_kafka import Consumer
@crunchie84
crunchie84 / .gitconfig.aliases
Created April 21, 2020 12:48
git alias for the win 💪
#
# Include this in your own .gitconfig by using the
# [include] directive with the path to this file
#
# [include]
# path = ~/.gitconfig.aliases
#
# If you don't have any existing includes, you can add this via the following command
#
# git config --global include.path ~/.gitconfig.aliases
@rust-play
rust-play / playground.rs
Created October 6, 2019 19:16
Code shared from the Rust Playground
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::cmp::Eq;
#[derive(Debug)]
pub struct RawKV {
key: String,
value: String
}
@ecoshub
ecoshub / IntToByteArray.go
Last active August 23, 2024 08:31
golang integer to byte array and byte array to integer function
package main
import (
"fmt"
"unsafe"
)
func main(){
// integer for convert
num := int64(1354321354812)