Skip to content

Instantly share code, notes, and snippets.

@LucJosin
LucJosin / .golangci.yml
Last active June 18, 2024 21:58 — forked from maratori/.golangci.yml
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.55.2
# Original gist: https://gist.github.com/maratori/47a4d00457a92aa426dbd48a18776322
# Gist: https://gist.github.com/LucJosin/5ebd9f6df6b60253e615c0995e597850
run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
@Hunrik
Hunrik / eventrouter.go
Created June 15, 2023 14:17
SQS Consumer
package sqs
import (
"context"
"github.com/cloudevents/sdk-go/pkg/cloudevents"
)
// EventRouter can be used to route events to subscribe handlers to a specific event type
type EventRouter struct {
@mikegogulski
mikegogulski / copy-stripe-setup.py
Last active August 23, 2023 14:01
Copy Stripe production products and prices to test environment
### The best way to start is to use the "Delete all test data" button at https://dashboard.stripe.com/test/developers
### Setup:
import stripe
test = 'sk_test_51IXXXyoursecretkey'
prod = 'sk_live_51IXXXyoursecretkey'
@aasmpro
aasmpro / JetBrainsMono.css
Last active October 11, 2022 17:10
JetBrains Mono css / scss / font-face / stylesheets
/* 0. extract fonts into `JetBrainsMono` folder */
/* 1. check fonts `urls` with your directory structure */
/* normal fonts */
@font-face {
font-family: JetBrainsMono;
font-style: normal;
font-weight: 100;
src: url("../fonts/JetBrainsMono/ttf/JetBrainsMono-Thin.ttf") format("truetype");
@maratori
maratori / .golangci.yml
Last active June 21, 2024 08:34
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.59.1
#
# 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:
@ide
ide / fix-mac-audio.sh
Created July 10, 2020 02:02
Fix audio by restarting coreaudiod on macOS
# macOS regularly enters a bad state where audio doesn't play at all or the sound levels are miscalibrated and the
# speakers are quiet even at high volume settings. Various sites suggest different approaches, some of which worked for me
# and some which didn't.
#
# Restarting the audio daemon is ideal since you don't need to restart your computer and fortunately it has worked in
# several scenarios for me.
# This works for me the most when my audio doesn't work on video calls or when my sound levels are miscalibrated
sudo launchctl stop com.apple.audio.coreaudiod
sudo launchctl start com.apple.audio.coreaudiod
@embano1
embano1 / README.MD
Created September 23, 2019 14:54
Dockerfile for Go modules and built cache efficiency

Also works across git branches if you keep the intermediate build images around, e.g. those <none> images in the docker images output.

FROM golang:1.12 AS builder

# enable Go modules support
ENV GO111MODULE=on

WORKDIR $GOPATH/src/github.com/myrepo/myapp
package testing
import (
"fmt"
"github.com/google/go-cmp/cmp"
"github.com/onsi/gomega/format"
"github.com/onsi/gomega/types"
)
@mikejoh
mikejoh / my-tmux-setup.md
Last active January 9, 2022 09:43
My version of tmux (via iTerm2) on Mac OSX

tmux

Tested on Mac OSX High Sierra 10.13+ with iTerm2

Install tpm plugin manager

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

and add the following in the end of your ~/.tmux.conf, uncomment any plugins that you wont be using:

run '~/.tmux/plugins/tpm/tpm'
@ndrewnee
ndrewnee / echo_zap.go
Created October 14, 2017 22:06
ZapLogger is an example of echo middleware that logs requests using logger "zap"
package echomw
import (
"time"
"github.com/labstack/echo"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)