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
/* CSS Snippet For Responsive Table - Stylized */
/* Basic */
* {
box-sizing: border-box;
}
table {
border-spacing: 0px;
@tobihans
tobihans / 1-Laravel-Docker-SSL.md
Created November 11, 2021 19:58 — forked from JT501/1-Laravel-Docker-SSL.md
Laravel + nginx-proxy + docker-letsencrypt-nginx-proxy-companion

Deploy Laravel on Docker using nginx-proxy + docker-letsencrypt-nginx-proxy-companion

  1. Prepare two seperate docker compose file i.e docker-compose.nginx.yml & docker-compose.app.yml

  2. Create nginx directory and move docker-compose.nginx.yml into it.

  3. Create YOUR_DOMAIN.conf and YOUR_DOMAIN_location.conf in nginx directory.

  4. Copy the nginx.tmpl into nginx directory.

.css-selector {
    background: linear-gradient(16deg, #0d203f, #e3cb0e);
    background-size: 400% 400%;
    -webkit-animation: blu 9s ease infinite;
    -moz-animation: blu 9s ease infinite;
    -o-animation: blu 9s ease infinite;
    animation: blu 9s ease infinite;
}
@-webkit-keyframes blu {
    0%{background-position:76% 0%}
@tobihans
tobihans / emulator-install-using-avdmanager.md
Created February 17, 2022 07:52 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

@tobihans
tobihans / README.MD
Created March 30, 2022 20:28 — forked from izxxr/README.MD
Discord.py Webhook Guide (Both async and sync).

Basic Webhooks Example using Discord.py (Rewrite)

Webhooks are a great way to send messages to Discord without having a bot account. You just need a webhook URL and just do a POST request on that URL and the message will be sent to discord.

Webhooks can also be used if your bot has to send messages to a channel a lot. For example, If your bot has event logging so everytime having to fetch channel and sending can be slow so you can use some webhook magic.

This guide will tell you when exactly to use webhooks and how to use them in discord.py both async and using requests.

When to use webhooks?

  • You are sending messages into Discord from another app or program and don't want to get into issue of making a bot account.
  • You are sending messages frequently to a channel like events logging or error logging.
@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 / 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 / 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