Skip to content

Instantly share code, notes, and snippets.

View maynagashev's full-sized avatar
👨‍💻
Go get it

Evgeniy Maynagashev maynagashev

👨‍💻
Go get it
View GitHub Profile
@maratori
maratori / .golangci.yml
Last active May 17, 2025 09:00
Golden config for golangci-lint
# This file is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021-2025 Marat Reymers
## Golden config for golangci-lint v2.1.6
#
# 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 it to suit your needs.
# If this config helps you, please consider keeping a link to this file (see the next comment).
@slok
slok / pprof.md
Last active May 2, 2025 17:27
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@vbernabe
vbernabe / docker-compose.yml
Last active September 9, 2019 08:28
Use this boiler plate for development that will setup php, nginx, redis, mariadb, composer. You need my Dockerfile to setup custom libraries
# vbernabe
# This is a docker config to run containers with nginx, php, mariadb, redis, composer, adminer
# Environment variables setup the db user and pass so use it to connect
# Volumes will map the folder from your host machine to the container
# Links I use links to let the app container know to connect to the db container
version: "3.1"
services:
php:
build:
context: .
@CharlesHolbrow
CharlesHolbrow / ffmpeg-hls.html
Created September 13, 2018 22:44
Example of ffmpeg for live hls streaming with hls.js
<!DOCTYPE html>
<html lang='`en'>
<head>
<meta charset='utf-8'/>
<title>Audio only stream example</title>
<script src="//cdn.jsdelivr.net/npm/hls.js@latest"></script>
<style>
video {
width: 640px;
height: 360px;
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@thebrubaker
thebrubaker / .env
Last active March 4, 2025 23:54
Laravel Passport: SPA Frontend Authentication
# Added to the bottom of my file
PROXY_OAUTH_CLIENT_ID=2
PROXY_OAUTH_CLIENT_SECRET=SECRET-GENERATED-KEY-HERE
PROXY_OAUTH_GRANT_TYPE=password
@bmccormack
bmccormack / readme.md
Last active May 26, 2019 14:55
Relative anchor links for your documentation

You know relative anchor links, right? They're the things that help you to link to a section of a document, e.g. https://example.com/your-doc#part-of-doc. This is especially helpful for customer support help centers (knowledge bases, documentation, etc).

I can never ever remember how to do this, so I'm making this gist to store my brain on the internet. Here are some things I forget:

  • Use name to name your relative link
  • Don't include # in the name value
@ipedrazas
ipedrazas / dump
Created April 22, 2017 04:10
Mongo dump/restore with docker
# Backup DB
docker run \
--rm \
--link running_mongo:mongo \
-v /data/mongo/backup:/backup \
mongo \
bash -c ‘mongodump --out /backup --host $MONGO_PORT_27017_TCP_ADDR’
# Download the dump
scp -r USER@REMOTE:/data/mongo/backup ./backup
@Yogendra0Sharma
Yogendra0Sharma / redis_cheatsheet.bash
Created January 10, 2017 10:36 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@Rich-Harris
Rich-Harris / module-loading.md
Last active April 19, 2023 09:11
Dynamic module loading done right

Dynamic module loading done right

Follow-up to Top-level await is a footgun – maybe read that first

Here are some things I believe to be true:

  1. Static module syntax is beneficial in lots of ways – code is easier to write (you get better linting etc) and easier to optimise (tree-shaking and other things that are only really possible with static syntax), and most importantly, faster to load (it's trivial for a module loader to load multiple dependencies concurrently when they're declared with a static syntax – not so with imperative statements like require(...) or await import(...)).
  2. App startup time is perhaps when performance is most critical. (You already know this, I don't need to cite the studies.)
  3. If you're in favour of constructs that jeopardise app startup time, you are anti-user. Top-level await is such a construct.