Skip to content

Instantly share code, notes, and snippets.

@mrspartak
mrspartak / detect_goamd64.ps1
Last active September 23, 2025 04:45
Detect GOAMD64 level on linux machine
$script = {
$cpu = Get-WmiObject Win32_Processor
$flags = $cpu.Caption + " " + $cpu.Name + " " + $cpu.Description
function Check-Flag {
param([string]$flag)
return $flags -match $flag
}
if ((Check-Flag "AVX512F") -and (Check-Flag "AVX512BW") -and (Check-Flag "AVX512CD") -and (Check-Flag "AVX512DQ") -and (Check-Flag "AVX512VL")) {
@f3l1x
f3l1x / README.md
Last active September 15, 2025 13:00
Cloudflare Terraform Permissions

Cloudflare Terraform

terraform {
  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "4.23.0"
    }
 }
@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 October 11, 2024 14:45
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 December 13, 2025 06:30
Golden config for golangci-lint
# ==================================================================================================
#
# NOTICE
#
# This gist is no longer maintained. It was moved to repo:
#
# https://github.com/maratori/golangci-lint-config
#
# Full history and all v2 releases are preserved in the repo.
#
@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
@fabiolimace
fabiolimace / UUIDv6.sql
Last active September 21, 2025 04:10
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@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