Skip to content

Instantly share code, notes, and snippets.

View Norbiox's full-sized avatar

Norbert Chmiel Norbiox

View GitHub Profile
@Norbiox
Norbiox / gist:e9fc9e2728523173b6361598cff395fc
Created August 27, 2025 09:59
Import OTP accounts from text file to `pass otp`
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 <otp_urls_file>"
echo "File should contain otpauth:// URLs, one per line"
exit 1
fi
OTP_FILE="$1"
@Norbiox
Norbiox / translate.py
Created February 21, 2024 11:27
Call Google Translate with python
import sys
import requests
URL = "https://translate.googleapis.com/translate_a/single?client=gtx&dt=t&dt=bd&dt=md&dt=ex&sl={src_lang}&tl={dst_lang}&q={message}"
if __name__ == "__main__":
res = requests.get(URL.format(src_lang="pl", dst_lang="en", message=sys.argv[1], timeout=10))
print(res.json()[0][0][0])

FWIW: I (@Rondy) am not the author of the content presented here, which is an outline from Edmond Lau's book. I've just copy-pasted it from somewhere and saved as a personal gist, before it got popular on newsnews.ycombinator.com. I don't remember where exactly the original source is from and neither could find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

@Norbiox
Norbiox / .lua
Created January 12, 2023 07:59
Setup nvim-lint with pylint in neovim+mason to work in virtualenv
-- Set linters
require('lint').linters_by_ft = {
python = {'pylint'}
}
-- Set running linters on buffer save
vim.api.nvim_create_autocmd({"BufWritePost"}, {
callback = function()
require("lint").try_lint()
end,
@Norbiox
Norbiox / cloudSettings
Last active February 15, 2022 08:16
VSCode configuration
{"lastUpload":"2022-02-15T08:16:00.953Z","extensionVersion":"v3.4.3"}
@Norbiox
Norbiox / packtfreebooknotifier.py
Created July 24, 2019 12:08
This script scrapes info about free Packt book of the day and sends it in notification via email to subscribents from list.
#!/usr/bin/python3
"""Packt Daily Free Book Notifier
Best to use as a cron task.
Setting up:
* install requirements with command:
pip3 install --user requests-html
@Norbiox
Norbiox / zadanka_od_Damiana.fs
Last active January 23, 2019 14:32
Zadanka od Damiana
module zadanka
open System
// Zad 1
type bus_stop =
{
Name: string
City: string
@Norbiox
Norbiox / .vimrc
Created January 16, 2019 09:09
VIM configuration
call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'joshdick/onedark.vim'
Plug 'sheerun/vim-polyglot'
call plug#end()
let g:lightline = {
\ 'colorscheme': 'onedark',
\ }
@Norbiox
Norbiox / get_sound.py
Created November 13, 2018 15:13
Proste nagrywanie i streaming dźwięku z użyciem biblioteki souddevice
# https://python-sounddevice.readthedocs.io/en/0.3.12/installation.html
import queue
import numpy as np
import sounddevice as sd
# zmienne globalne i ustawienia souddevice
SAMPLERATE = sd.default.samplerate = 40000
CHANNELS = sd.default.channels = 1
MAPPING = [c - 1 for c in range(CHANNELS)]
@Norbiox
Norbiox / perfect-elementary.sh
Last active February 15, 2019 08:49
Elementary OS 5 Juno after-install
# update & upgrate
sudo apt-get update && sudo apt-get upgrade -y
# common
sudo apt-get install apt-transport-https -y
# docker
sudo apt-get install \
apt-transport-https \
ca-certificates \