Skip to content

Instantly share code, notes, and snippets.

View smoya's full-sized avatar
🛩️
Flying @asyncapi airlines

Sergio Moya smoya

🛩️
Flying @asyncapi airlines
View GitHub Profile
@kevinswiber
kevinswiber / websocket_handshake_probe.sh
Created November 12, 2021 21:13
A simple bash script for checking if a WebSocket endpoint is alive.
#!/bin/bash
self=`basename "$0"`
if (($# == 0)); then
cat <<EOF
Usage: $self url
Example: $self http://localhost:3000/echo
Check if a URL is returning a valid WebSocket handshake response.
@thomaspoignant
thomaspoignant / Makefile
Last active April 5, 2024 08:50
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@kshcherban
kshcherban / aws-mfa.sh
Last active September 1, 2021 20:20
Simple script to set AWS creds with MFA auth, just put it in your bashrc like `alias mfa='. ~/.local/bin/aws-mfa.sh $@'`
#!/bin/bash
#set -eo pipefail
#
# Sample for getting temp session token from AWS STS
#
# aws --profile youriamuser sts get-session-token --duration 3600 \
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345
#
# 1 or 2 args ok
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active April 19, 2024 11:13
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@ldez
ldez / gmail-github-filters.md
Last active April 3, 2024 11:53
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label

How to calculate your hourly rate as a freelancer?

Many people struggle with this question. Some just try to make as much as a full-time employee makes (and ignore that they won't be able to bill as many days). Others follow tips on startup related websites that suggest to ask for 20% to 50% more than an salary would yield (and ignore the additional risk and expenses they have).

Below you will find some numbers to help you calculate how high your hourly or daily rate should be.

Your yearly income should be higher than an average salary

  • You take more risk than full time employees, phases without income are likely
@smiller171
smiller171 / godeps-full.sh
Last active June 12, 2017 17:27
List all go dependencies that are not in the standard library
go list -f '{{join .Deps "\n"}}' | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: