Skip to content

Instantly share code, notes, and snippets.

View ricardobranco777's full-sized avatar

Ricardo Branco ricardobranco777

View GitHub Profile
import telegram
import openai
# Replace 'YOUR_TELEGRAM_TOKEN' and 'YOUR_OPENAI_API_KEY' with your actual tokens.
telegram_token = 'YOUR_TELEGRAM_TOKEN'
openai_api_key = 'YOUR_OPENAI_API_KEY'
# Initialize the Telegram bot.
bot = telegram.Bot(token=telegram_token)
@ricardobranco777
ricardobranco777 / tz.py
Created April 11, 2019 08:59
Get timezone using time module
import time
def get_timezone():
return time.tzname[time.localtime().tm_isdst]
@ricardobranco777
ricardobranco777 / copy.go
Last active April 3, 2024 06:42
Copy file from Docker image to standard output
package main
import (
"archive/tar"
"fmt"
"io"
"io/ioutil"
"os"
"github.com/docker/docker/api/types"
@ricardobranco777
ricardobranco777 / walk.go
Last active February 7, 2017 23:34
walk.go
package main
import (
"flag"
"fmt"
"github.com/mirtchovski/walk"
"log"
"os"
"runtime/pprof"
"time"