Skip to content

Instantly share code, notes, and snippets.

View Mgregchi's full-sized avatar
🏠
Working from home

Amadi Michael C Mgregchi

🏠
Working from home
View GitHub Profile
@Mgregchi
Mgregchi / bs5-popover.html
Created October 2, 2021 10:27
Html contents inside a bootstrap 5 popover
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
$(function() {
var options = {
html: true,
title: "Optional: HELLO(Will overide the default-the inline title)",
//html element
@Mgregchi
Mgregchi / bs5-popover-v1-snippet.html
Last active October 11, 2021 09:16
Custom Bootstrap popover snippet
<div hidden >
<div data-name="popover-content">
<div class="input-group">
<input type="text" class="form-control form-control-sm" placeholder="Search" name="search">
<div class="input-group-btn">
<button class="btn btn-danger" type="submit">
<i class="bi bi-search fa fa-search"></i>
</button>
</div>
@Mgregchi
Mgregchi / JQuery-load-and-use-content.html
Created October 27, 2021 15:03
Access and use html elements from a page loaded with JQuery
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name='viewport' content='width=device-width, initial-scale=1'>
<meta name="author" content="Mgregchi, Michael Amadi, @Mgregchi">
<meta name="email" content="mgregchi@gmail.com">
<title>How to work with JQuery load() contents</title>
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css' rel='stylesheet' onerror="">
<script type='text/javascript' src='https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js'></script>
@Mgregchi
Mgregchi / load-content-method-2.js
Last active October 27, 2021 15:08
Access and use html elements from page loaded with JQuery .load()
$(document).ready(function(){
$("#loader").click(function(){
$("#container").load("/jquery-load-shopping-basket/",
function(e){
$(this).find("#empty-basket-search")
.keypress(function(e){
$("#single-label").text("You've clicked: ".concat(e.keyCode))
@Mgregchi
Mgregchi / load-content-method-1.js
Last active October 27, 2021 15:08
Access and use html elements from a page loaded with JQuery
$(document).ready(function(){
$("#loader").click(function(){
$("#container").load("/jquery-load-shopping-basket/",
function(e){
//Mix
$("empty-basket-search")
.prevObject[0]
.getElementById("empty-basket-search")
@Mgregchi
Mgregchi / screenshot.py
Last active March 24, 2022 20:42
Simple GUI anywhere screenshot taker
# Python 3
#FOR TAKING USER PREDEFINED SCREENSHOTS
# SCREENSHOT
from PIL import ImageGrab
# GUI
import PySimpleGUI as sg
# FOLDER AND DIRECTORY
import os
# GENERIC NAMING
@Mgregchi
Mgregchi / how_to_install_mysql_5.7_ubuntu.md
Created April 28, 2023 11:04
How to install MySQL 5.7* on ubuntu

Introduction:

Have you ever wondered what happens behind the scenes when you type "https://www.google.com" in your browser and hit Enter? It's like opening a magical door that leads you to the vast realm of the internet. Let's embark on an exciting journey filled with technical wonders and demystify the fascinating process step by step!

DNS Request - Unlocking the Address:

The first stop on our journey is the Domain Name System (DNS). When you enter "https://www.google.com," your browser sends a DNS request to find the corresponding IP address for the domain name. Think of it as asking a friendly wizard to translate the website's name into its secret location coordinates.

TCP/IP - Building the Pathway:

@Mgregchi
Mgregchi / ckeditor_uploader_value_error.md
Created June 19, 2023 15:01
Ckeditor_uploader ValueError: source code string cannot contain null bytes

I struggled a whole day trying to solve the error below with no success.

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Users\USER-PC\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "C:\Users\USER-PC\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\USER-PC\Documents\ALX\vpnprobe\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
@Mgregchi
Mgregchi / apache2-server-name-error.md
Last active June 20, 2023 09:44
Resolving the Mysterious Apache2 Error: Set ServerName Directive Globally

Resolving the Mysterious Apache2 Error: Set ServerName Directive Globally

Introduction:

When it comes to managing Apache2, encountering error messages can be a frustrating experience. One such error message that often perplexes users is the infamous "AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message." But fret not! In this blog post, we will unravel the mystery behind this error and guide you step-by-step on how to fix it. So, let's dive in and eliminate this pesky error message once and for all!

Understanding the Error: Typically, you may come across this error message while starting or restarting the apache2 service, or when reviewing the apache2 error logs on a Debian system. It indicates that the server's fully qualified domain name could not be determined reliably, and urges you to set the 'ServerName' directive globally to suppress the message.

The Solution: Fortunately, resol