Skip to content

Instantly share code, notes, and snippets.

View egorsmkv's full-sized avatar
🌍
world, hello

Yehor Smoliakov egorsmkv

🌍
world, hello
View GitHub Profile
@thecrypticace
thecrypticace / webpack.mix.js
Created September 24, 2020 13:02
Mix + custom API for separate builds
const mix = require("laravel-mix")
mix.site = (id, callback) => {
if (!process.env.SITE || process.env.SITE === id) {
return callback()
}
};
mix.site('admin', () => {
mix.js("resources/js/admin/app.js", "public/js/admin.js")
@johnmeade
johnmeade / snr.py
Last active March 11, 2024 18:54
WADA SNR Estimation of Speech Signals in Python
import numpy as np
def wada_snr(wav):
# Direct blind estimation of the SNR of a speech signal.
#
# Paper on WADA SNR:
# http://www.cs.cmu.edu/~robust/Papers/KimSternIS08.pdf
#
# This function was adapted from this matlab code:
# https://labrosa.ee.columbia.edu/projects/snreval/#9
@procrastinatio
procrastinatio / haproxy_rate_limiting.md
Created October 25, 2017 06:04
Rate limiting with HAproxy

Introduction

So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])

@rudolfbyker
rudolfbyker / split_wav.py
Created April 25, 2017 10:35
Split WAV files at silence
#!/usr/bin/env python
from scipy.io import wavfile
import os
import numpy as np
import argparse
from tqdm import tqdm
# Utility functions
@harlow
harlow / worker-pool.go
Last active November 3, 2022 19:52
Worker pool to control concurrency and collect results
package main
import (
"fmt"
"sync"
"time"
)
const concurrency = 3
@bnagy
bnagy / gpgmutt.md
Last active March 30, 2024 07:52
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@tmilos
tmilos / README.md
Last active March 18, 2024 05:34
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

@stuart-warren
stuart-warren / simple-gpg-enc.go
Last active October 11, 2023 01:21
golang gpg/openpgp encryption/decryption example
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"io/ioutil"
"log"
"os"
)
@Belphemur
Belphemur / build_nginx.sh
Last active November 13, 2022 13:05 — forked from MattWilcox/build_nginx.sh
Compiling Nginx with LibreSSL (and http2)
#!/usr/bin/env bash
# names of latest versions of each package
export NGINX_VERSION=1.15.5
export VERSION_NGINX=nginx-$NGINX_VERSION
export VERSION_LIBRESSL=libressl-2.8.1
export VERSION_PCRE=pcre-8.42
#export NPS_VERSION=1.9.32.10
#export VERSION_PAGESPEED=v${NPS_VERSION}-beta