Skip to content

Instantly share code, notes, and snippets.

View tobihans's full-sized avatar
🙃
Keeping it Super Simple !

Hans Bignon K. Tognon tobihans

🙃
Keeping it Super Simple !
View GitHub Profile
@tobihans
tobihans / error_handler.py
Created March 31, 2022 15:25 — forked from EvieePy/error_handler.py
Simple Error Handling for ext.commands - discord.py
"""
If you are not using this inside a cog, add the event decorator e.g:
@bot.event
async def on_command_error(ctx, error)
For examples of cogs see:
https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
For a list of exceptions:
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#exceptions
@tobihans
tobihans / Liberal Regex Pattern for Web URLs
Created April 1, 2022 13:21 — forked from gruber/Liberal Regex Pattern for Web URLs
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s
@tobihans
tobihans / vim.desktop
Created July 5, 2022 06:01
Vim desktop entry file
[Desktop Entry]
Categories=CodeEditor;
Comment[en_US]=Edit with Vim
Comment=Edit with Vim
Exec=x-terminal-emulator -e vim
GenericName[en_US]=Editor
GenericName=Editor
Icon=gvim
MimeType=
Name[en_US]=Vim
@tobihans
tobihans / fedora_install_python3.md
Created September 9, 2022 06:07 — forked from zobayer1/fedora_install_python3.md
Install Python 3.6, 3.7, 3.8 in your Fedora system

Python 3.9 comes as a default with Fedora 34. However, sometimes you may wish to install older versions for development and test purposes. Apart from groupinstall command, these instructions work for CentOS and REHL systems as well.

Prerequisites

Install python development dependencies.

sudo dnf groupinstall "Development Tools"
sudo dnf install python3-devel openssl-devel zlib-devel bzip2-devel sqlite-devel libffi-devel

Note: You will need to rebuild and reinstall if you install new source or development libraries for python. Do not create or modify symlinks for python, python3, etc, as that may and will break many dependent libraries in your system.

@tobihans
tobihans / binary.sh
Created September 9, 2022 17:44
Learning about ASCII and Binary representations
#!/bin/bash
str="$*"
for ((i = 0; i < ${#str}; i++))
do
char="${str:$i:1}"
conv=$(LC_CTYPE=C printf '%d\n' "'$char")
echo -n "$(echo "obase=2; ibase=10; $conv" | bc)"
done
@tobihans
tobihans / v4l2_capture.c
Created September 10, 2022 21:18 — forked from shakkhar/v4l2_capture.c
Using Libav API to capture from V4L2 device. (This is based on doc/examples/demuxing_decoding.c from FFmpeg codebase. I had to modify it because FFmpeg does not ship with Ubuntu.)
/*
* Copyright (c) 2012 Stefano Sabatini
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
@tobihans
tobihans / README.md
Last active September 27, 2022 22:16
Resources for Db administration (MsSQL & Oracle)
@tobihans
tobihans / README.md
Created September 29, 2022 06:29
Correction Latex

Partie I

Exercice I

a-) chapter b-) \tableofcontents c-) \bibitem ou thebibliography(environnement) d-) eqnarray (env) e- fancy

Exercice II

FROM base/archlinux
ADD dotfiles/vimrc /root/.vimrc
ADD dotfiles/vim /root/.dotfiles/vim
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm \
neovim \
git \
python2-neovim \