Skip to content

Instantly share code, notes, and snippets.

View lartie's full-sized avatar
👀
looking for a interesting startups

Artemy lartie

👀
looking for a interesting startups
View GitHub Profile
@Scoder12
Scoder12 / README.md
Last active April 14, 2024 21:37
Valutwarden config for docker-compose

Vaultwarden docker-compose nginx

My setup for vaultwarden. Uses a custom certificate authority to sign certificates. Expects vaultwarden.crt and vaultwarden.pem to be in ./crts.

See https://github.com/ttionya/vaultwarden-backup for instructions on how to configure rclone for backups.

@zdebra
zdebra / throttled_transport.go
Created June 15, 2021 14:48
NewThrottledTransport wraps transportWrap with a rate limitter, improvement of https://gist.github.com/MelchiSalins/27c11566184116ec1629a0726e0f9af5 since it allows use of *http.Client
package main
import (
"net/http"
"time"
"golang.org/x/time/rate"
)
// ThrottledTransport Rate Limited HTTP Client
@slok
slok / pprof.md
Last active June 11, 2024 00:04
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@akhenakh
akhenakh / app.yaml
Last active March 4, 2023 19:22
Example of graceful shutdown with grpc healthserver * httpserver
readinessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 1
livenessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 2
imagePullPolicy: IfNotPresent
@recoilme
recoilme / checkTelegramAuthorization.go
Created February 14, 2018 07:32
Check Telegram Authorization in golang
// check telegram authorization on golang
//php version: https://gist.github.com/anonymous/6516521b1fb3b464534fbc30ea3573c2#file-check_authorization-php
//usage:
/*
func TestTg(t *testing.T) {
data := "id=1263310&first_name=Vadim&last_name=Kulibaba&username=recoilme&photo_url=https://t.me/i/userpic/320/recoilme.jpg&auth_date=1518535618&hash=1d7069137bf517a63261ee156919a057dca93a416118eebfd0d8f5697442cdce"
token := "YOUR:TOKEN"
if !checkTelegramAuthorization(data, token) {
t.Fail()
}
@renatoagomes
renatoagomes / setup-jasminsms-docker.md
Last active April 3, 2018 09:01
Setup JasminSMS com Docker localmente
@kariae
kariae / .gitlab-ci.yml
Created June 6, 2017 17:29
GitLab CI/CD configuration for Symfony
variables:
REGISTRY_URL: registry.lekode.com:5000
IMAGE_NAME: app
BUILD_CODE_IMAGE: $REGISTRY_URL/$IMAGE_NAME:$CI_COMMIT_REF_NAME
LATEST_CODE_IMAGE: $REGISTRY_URL/$IMAGE_NAME:latest
stages:
- test
- install
- build
@jamonholmgren
jamonholmgren / plug.conn.ex
Created March 9, 2016 07:00
Typical Elixir Phoenix Plug.Conn struct contents, in an easy-to-read format. By Jamon Holmgren.
%Plug.Conn{
adapter: {Plug.Adapters.Cowboy.Conn, :...},
assigns: %{
my_assigns: "here"
},
before_send: [
#Function<7.125546534/1 in Phoenix.Controller.fetch_flash/2>,
#Function<1.127904613/1 in Plug.Session.before_send/2>,
#Function<1.43511252/1 in Plug.Logger.call/2>,
#Function<0.70322810/1 in Phoenix.LiveReloader.before_send_inject_reloader/1>
@AndreyStekov
AndreyStekov / pg_schema_size.sql
Created April 6, 2015 09:58
Get schema size (postgres).
SELECT pg_size_pretty(sum(pg_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)))::bigint) FROM pg_tables
WHERE schemaname = 'yourschema'
@swayson
swayson / csvkit-eg.md
Last active February 8, 2024 20:06
CSVKit Examples

1. Ditch Excel (for real)

    in2csv file1.xls > file1.csv

2. Conquer fixed-width formats

    in2csv -f fixed -s schema.csv data.fixed > data.csv

3. Find cells matching a regular expression

csvgrep -c phone_number -r "\d{3}-123-\d{4}" data.csv > matching.csv