Skip to content

Instantly share code, notes, and snippets.

View jonatasnona's full-sized avatar
🇧🇷
Working from home

Jonatas Pedraza jonatasnona

🇧🇷
Working from home
View GitHub Profile
@jonatasnona
jonatasnona / README.md
Created May 24, 2019 01:17 — forked from eliquious/README.md
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys

@jonatasnona
jonatasnona / iterm2.md
Created February 14, 2019 18:18 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@jonatasnona
jonatasnona / dst.py
Created November 4, 2018 11:56 — forked from dpapathanasiou/dst.py
How to tell if Daylight Savings Time is in effect using Python
from datetime import datetime
import pytz
def is_dst ():
"""Determine whether or not Daylight Savings Time (DST)
is currently in effect"""
x = datetime(datetime.now().year, 1, 1, 0, 0, 0, tzinfo=pytz.timezone('US/Eastern')) # Jan 1 of this year
y = datetime.now(pytz.timezone('US/Eastern'))
@jonatasnona
jonatasnona / main.go
Created May 18, 2018 14:33 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@jonatasnona
jonatasnona / strategy.go
Created May 11, 2018 18:30 — forked from vaskoz/strategy.go
Golang strategy pattern
package main
import "fmt"
type Strategy func(string, string) string
type Strategic interface {
SetStrategy(Strategy)
Result() string
}
@jonatasnona
jonatasnona / simple_args_parsing.sh
Created April 4, 2018 16:47 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@jonatasnona
jonatasnona / gist:733dfdc81fc39587b14051d5f698ef55
Created April 2, 2018 17:20 — forked from sillage/gist:1336681
Save a file in UTF-8 encoding with Vim
:wq! ++enc=utf-8
@jonatasnona
jonatasnona / tmux-cheatsheet.markdown
Created February 24, 2018 03:12 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jonatasnona
jonatasnona / docker-cleanup-resources.md
Created September 29, 2017 14:50 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm