Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Rafael Lossurdo lossurdo

🏠
Working from home
View GitHub Profile
@lossurdo
lossurdo / convert-utc-timezone.py
Last active Feb 20, 2020
Convert UTC to your time zone
View convert-utc-timezone.py
#!/usr/bin/python3
# coding: utf-8
from datetime import datetime
# pip3 install pytz
import pytz
def convert(posix_timestamp, your_timezone='America/Sao_Paulo'):
utc_dt = datetime.utcfromtimestamp(posix_timestamp).replace(tzinfo=pytz.utc)
tz = pytz.timezone(your_timezone)
@lossurdo
lossurdo / dict.sh
Created Jan 22, 2020
Online dictionary shell script
View dict.sh
#!/bin/sh
# Documentation:
# https://tools.ietf.org/html/rfc2229
if [ -z "$1" ]
then
echo "No word supplied! \nCommand: 'dict.sh <word>' eg. 'dict.sh linux'"
exit 1
fi