
Downgrade PHP 8 to PHP 7.4
In ubuntu:
sudo apt-get purge php8.*
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.4Integrity Ansi Pack Videos
Integrity was an art group founded by Darkforce and Grateful Dead in 1994. Integrity primarily released ansi art.
first/last release: 1995/01 – 1995/12
years active: 1995 (10)
(sub)packs released: 10
smallest/largest pack: int-roqs/int-0895
lifetime artworks: 174
lifetime lines: 11 829

ViViD Art Pack Videos
Streaming videos from the art group Vivid on my twitch page

More info at 16colo.rs
ViViD (vivid)
first/last release: 1995/08 – 1998/12
years active: 1995 (2), 1997 (2), 1998 (4), 1999 (1)
(sub)packs released: 9
smallest/largest pack: vivid-07/viv-1295
lifetime artworks: 228
lifetime lines: 7 194
average # of lines per artwork: 37
average # of artworks per pack: 25
longest serving member(s): paranormal intensity (1997/11-1998/12)
most productive member: paranormal intensity (68)

Connecting PHP to MySQL (MySQLi & PDO)
This is the most asked question I have seen in the past few months so I thought I would collect some samples here:
MySQLi Connect Example (non Object)
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // Make MySQLi throw exceptions.
try {
// Try Connect to the DB with mysqli_connect function - Params {hostname, userid, password, dbname}
$link = mysqli_connect("localhost", "root", "", "mysqli_examples");
} catch (mysqli_sql_exception $e) { // Failed to connect? Lets see the exception details..
echo "MySQLi Error Code: " . $e->getCode() . "<br />";
echo "Exception Msg: " . $e->getMessage();
exit; // exit and close connection.
}
//No Exceptions were thrown, we connected successfully, yay!
echo "Success, we connected without failure! <br />";
echo "Connection Info: " . mysqli_get_host_info($link) . PHP_EOL;
/*
* Do some cool mysqli stuff...
*/
mysqli_close($link); // finally, close the connection
?>MySQLi Connect Example (Object)
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // Make MySQLi throw exceptions.
try {
// Try Connect to the DB with new MySqli object - Params {hostname, userid, password, dbname}
$link = new mysqli("localhost", "root", "", "mysqli_examples");
} catch (mysqli_sql_exception $e) { // Failed to connect? Lets see the exception details..
echo "MySQLi Error Code: " . $e->getCode() . "<br />";
echo "Exception Msg: " . $e->getMessage();
exit; // exit and close connection.
}
//No Exceptions were thrown, we connected successfully, yay!
echo "Success, we connected without failure! <br />";
echo "Connection Info: " . mysqli_get_host_info($link) . PHP_EOL;
/*
* Do some cool mysqli stuff...
*/
mysqli_close($link); // finally, close the connection
?>PHP MySQLi Prepare
$statement = mysqli_prepare($link, "select user_name, first_name, last_name from users_table where id = 1");
OR
$statement = mysqli_prepare($link, "select user_name, first_name, last_name from users_table where id = ?");
mysqli_stmt_bind_param($statement, "?", 1);PHP MySQLi Select DB
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // Make MySQLi throw exceptions.
try {
// Try Connect to the DB with new MySqli object - Params {hostname, userid, password, dbname}
$link = mysqli_connect("localhost", "root", "", "mysqli_examples");
// Select all records from the db. Keep inside try block incase there an issue with sql query
$result = mysqli_query($link, "select username, first_name, last_name, gender from users");
} catch (mysqli_sql_exception $e) { // Failed to connect? Lets see the exception details..
echo "MySQLi Error Code: " . $e->getCode() . "<br />";
echo "Exception Msg: " . $e->getMessage();
exit; // exit and close connection.
}
/*
* Do some cool mysqli stuff with our data
*/
while($row = mysqli_fetch_assoc($result))
{
$users[] = $row;
}
var_dump($users);
mysqli_close($link); // finally, close the connectionObject-Oriented Style Select
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // Make MySQLi throw exceptions.
try {
// Try Connect to the DB with new MySqli object - Params {hostname, userid, password, dbname}
$mysqli = new mysqli("localhost", "root", "", "mysqli_examples");
// Select all records from the db. Keep inside try block incase there an issue with sql query
$query = "select username, first_name, last_name, gender from users";
if ($result = $mysqli->query($query)) {
/* fetch associative array */
while ($row = $result->fetch_assoc()) {
var_dump($row);
}
/* free the memory associated with this result set */
$result->free();
}
} catch (mysqli_sql_exception $e) { // Failed to connect? Lets see the exception details..
echo "MySQLi Error Code: " . $e->getCode() . "<br />";
echo "Exception Msg: " . $e->getMessage();
exit; // exit and close connection.
}
$mysqli->close(); // finally, close the connection
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // Make MySQLi throw exceptions.
try {
// Try Connect to the DB with new MySqli object - Params {hostname, userid, password, dbname}
$link = mysqli_connect("localhost", "root", "", "mysqli_examples");
// Select all records from the db. Keep inside try block incase there an issue with sql query
$result = mysqli_query($link, "select username, first_name, last_name, gender from users");
} catch (mysqli_sql_exception $e) { // Failed to connect? Lets see the exception details..
echo "MySQLi Error Code: " . $e->getCode() . "<br />";
echo "Exception Msg: " . $e->getMessage();
exit; // exit and close connection.
}
/*
* use mysqli_fetch_array and loop through data
*/
while ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
var_dump($row);
}
mysqli_close($link); // finally, close the connectionCopyProcedural Style
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // Make MySQLi throw exceptions.
try {
// Try Connect to the DB with new MySqli object - Params {hostname, userid, password, dbname}
$link = mysqli_connect("localhost", "root", "", "mysqli_examples");
// Select all records from the db. Keep inside try block incase there an issue with sql query
$result = mysqli_query($link, "select username, first_name, last_name, gender from users");
} catch (mysqli_sql_exception $e) { // Failed to connect? Lets see the exception details..
echo "MySQLi Error Code: " . $e->getCode() . "<br />";
echo "Exception Msg: " . $e->getMessage();
exit; // exit and close connection.
}
/*
* use mysqli_fetch_array and loop through data
*/
while ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
var_dump($row);
}
mysqli_close($link); // finally, close the connectionCopyObject Oriented style
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // Make MySQLi throw exceptions.
try {
// Try Connect to the DB with new MySqli object - Params {hostname, userid, password, dbname}
$mysqli = new mysqli("localhost", "root", "", "mysqli_examples");
// Select all records from the db. Keep inside try block incase there an issue with sql query
$query = "select username, first_name, last_name, gender from users";
if ($result = $mysqli->query($query)) {
//Use mysqli fetch_array and use the MYSQLI_BOTH Parameter for both indexed and associative data
while ($row = $result->fetch_array(MYSQLI_BOTH)) {
var_dump($row);
}
/* free the memory associated with this result set */
$result->free();
}
} catch (mysqli_sql_exception $e) { // Failed to connect? Lets see the exception details..
echo "MySQLi Error Code: " . $e->getCode() . "<br />";
echo "Exception Msg: " . $e->getMessage();
exit; // exit and close connection.
}
$mysqli->close(); // finally, close the connection
Why is .gitignore not ignoring my files?
.gitignore only ignores files that are not part of the repository yet. If you already git added some files, their changes will still be tracked. To remove those files from your repository (but not from your file system) use git rm --cached on them.

Create a Discord Bot Using Asynchronous PHP in 4 steps
Intro
The landscape right now for Discord bots is filled with python and javascript. These work well but what about our beloved PHP? There is a project named Discord-PHP which bridges the gap for us using asynchronous PHP to keep our bot alive.
Prerequisites
- PHP 7.2 or higher
- Composer
ext-jsonext-zlib
1. Create a new application
The first thing you need to do is head over to the Discord developer portal and create a new application. Open a browser and visit:
Make sure you have logged in. Click on the “New Application” button in the top right corner, give your application a name, and click on the “Create” button.
Now we need to add a bot user to this application. Click on “Bot” in the main menu and then on the “Add Bot” button. As this action is irrevocable, you will have to confirm by clicking the “Yes, do it!” button.
2. Building the bot
Create a directory for the project
mkdir -p $HOME/Code/chuckcd $HOME/Code/chuck
Initialize Composer and require the dependencies
composer init --name="bypaul/chuck" -ncomposer require team-reflex/discord-php
Add a file named “bot.php” to the root of your project with this content:
<?php
use Discord\Discord;
use Discord\Parts\Channel\Message;
use Psr\Http\Message\ResponseInterface;
use React\EventLoop\Factory;
use React\Http\Browser;
require __DIR__ . '/vendor/autoload.php';
$loop = Factory::create();
$browser = new Browser($loop);
$discord = new Discord([
'token' => '',
'loop' => $loop,
]);
$discord->on('message', function (Message $message, Discord $discord) use ($browser) {
if (strtolower($message->content) == '!joke') {
$browser->get('https://api.chucknorris.io/jokes/random')->then(function (ResponseInterface $response) use ($message) {
$joke = json_decode($response->getBody())->value;
$message->reply($joke);
});
}
});
$discord->run();You will need to update 'token' => '' with the token for your bot. Go back to Discord Developer Portal and click on Bot in the main menu; there, you can find and copy your token.
And that’s it. Congratulations, you have just created a Discord bot using asynchronous PHP.
The above code listens for any new messages on the server. When a new message event is received, it checks if the content equals “!joke”, and if it does, it makes a GET request to https://api.chucknorris.io/jokes/random to get a random joke and replies it back to the server.
If you have never come in contact with asynchronous PHP and ReactPHP before, this code might seem a bit strange, and I would advise you to visit ReactPHP: (Event-driven, non-blocking I/O with PHP) to get you acquainted with it.
3. Inviting the bot to your server
Next, you will need to invite the bot to a server where you can try it out. If you don’t have a server, you will first need to create one. You invite the bot by going to Discord Developer Portal click on OAuth2, select “bot” for scopes, and add the permissions the bot requires. I have chosen “Administrator” for simplicity, but you should only give your bot the permissions it requires.

Copy and paste the link in your browser’s address bar, hit enter, and follow the instructions to add the bot to your server.
4. Running the bot
Now all that’s left is running the bot and trying it out. From the root of your project run:
php bot.php

This was taken from https://levelup.gitconnected.com/4-steps-to-create-a-discord-bot-using-asynchronous-php-951082d7677a

Create your own Discord bot with Python
What is the best way to develop a Discord bot? You’ve always wondered about this, and we’re here to walk you through the process of creating your own Discord bot. You may make a Discord bot on any platform, including smartphones, tablets, and computers.
We’ll use repl.it to run the bot in this tutorial, but you may also run it locally. With repl.it, your bot will be able to run 24 hours a day, 7 days a week for FREE! This tutorial utilizes Python, but you may also use Javascript/NodeJs.
To begin, we must create a bot on the Discord Developer Portal.
Using the Discord Developer Portal to Create a Bot 1. Log in to the Discord Developer Portal with your Discord account.
- Select New Application from the menu bar.
3. Name your application
4. Head to the Bots tab and click on Add A Bot
5. Copy the token as you’re going to need it later on, the token is like the password for your bot, do not share it to anyone you don’t trust or they will be able to hack and log into your bot
Let’s get started building the bot in Repl.it!
- Create a free repl.it account.
- Create a repl with Python as the language of choice.
Begin by adding import discord to the top of main.py’s first line. Discord.py will be automatically installed when you run the repl.
import discordLet’s get started planning the events now! When the bot is ready and online, you can use the on ready method to control what it does!
Consider the following scenario:
import discord
client = commands.Bot(command_prefix="%")
@client.event
async def on_ready():
print('Bot is ready')
print('Bot is ready')When the bot logs on successfully, this emits “Bot is ready” in the console.
You may use the client function to make configuring your prefixes easier, and it also allows the bot to respond to commands that begin with the prefix!
Commands
Let’s go on to our first command:
from discord.ext import commands @client.command(aliases=[‘hi’]) async def hello(ctx): await ctx.send(“Hi there my friend!”)
If you type %hello or its alias %hi, the bot will reply Hi there my friend! We also need to import commands from discord.ext in order for commands to operate!
How to make the bot work
- Return to the previous tab of the Discord Developer Portal.
- Go to Bots, copy the Token, and don’t give it to anyone else because they’ll be able to hack into your bot.
- Return to your repl and create an environment titled TOKEN in the sidebar, then paste your token into the key. Environments are.env files that prohibit outsiders from viewing and hacking into your token. Anyone can access your code on Repl.it’s free plans, but they can’t see your environment files.
- In order to use.env files, we must first import the os module.
import os secret = os.environ['TOKEN']
os.environ finds the .env file, and now your bot is hack-free!
5. In the last line of your code, add this in order for the bot to login
client.run(secret)6. Now, head to shell, and run the command to install discord on your repl
pip install discord
7. You can now run the bot by clicking the Run button, your code should be something like this, change the token to your bot token
If the console prints Bot is ready, then your code is probably correct!
How to add the bot to your server
1. Head to OAuth2 on the sidebar, select bot, and the required permissions
2. Now copy the generated link and paste it in a new tab
3. Select the server you would like to invite it to
4. Test the bot, make sure it is online in the member list
How to send embed texts
Sending embed texts can be done easily by using the discord.Embed function, here’s an example below!
@client.command()
async def embed(ctx):
e=discord.Embed(
color=discord.Color.red(),
title="Title",
description="An embed text example"
)
await ctx.send(embed=e)How can I keep the bot online 24 hours a day, 7 days a week?
Your bot will cease operating if you run it in repl.it and then close the tab in which it is executing. You can buy a premium plan on repl.it to keep it running indefinitely, but you can also do it for free. Here’s how:
Every 5 minutes, we’ll use Uptime Robot to ping the bot’s web server on repl.it. The bot will never enter the sleeping state if there are continual pings, and will instead continue to run.
- To begin, we must first construct a web server in repl.it. We will use Flask to do so. Create a file called alive.py and paste the following code into it.
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I'm alive, and this is my web server!"
def run():
app.run(host='0.0.0.0',port=8080)
def alive():
t = Thread(target=run)
t.start()
In order to run alive.py from main.py, we need to add the following codes to it:
Add the code below to the top of main.py so it runs the alive function from the file.
from alive import alive
Now, add this code to the second-last line of your code, before your bot runs.
alive()
The full main.py code:
from alive import alive
import discord
import os
from discord.ext import commands
secret = os.environ['TOKEN']
client = commands.Bot(command_prefix="%")
@client.event
async def on_ready():
print('Bot is ready')
@client.command(aliases=['hi'])
async def hello(ctx):
await ctx.send("Hi there my friend!")
@client.command()
async def embed(ctx):
e=discord.Embed(
color=discord.Color.red(),
title="Title",
description="An embed text example"
)
await ctx.send(embed=e)
alive()
client.run(secret)The full alive.py code:
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I'm alive, and this is my web server!"
def run():
app.run(host='0.0.0.0',port=8080)
def alive():
t = Thread(target=run)
t.start()
Bootstrap breakpoint show / hide cheatsheet
I have been working on a project for a little while now and I have kept a tab open to this list the ENTIRE time. This has helped with every situation I have come across when it involves Bootstrap 5 breakpoints and how to show or hide elements easily. This list shows how to hide elements at a certain point “and down” i.e. show at large but hide at anything medium and down. Also the reverse is listed — show from extra small to medium and then hide.
Show/hide for breakpoint and down:
hidden-xs-down (hidden-xs)=d-none d-sm-blockhidden-sm-down (hidden-sm hidden-xs)=d-none d-md-blockhidden-md-down (hidden-md hidden-sm hidden-xs)=d-none d-lg-blockhidden-lg-down=d-none d-xl-blockhidden-xl-down(n/a 3.x) =d-none(same ashidden)
Show/hide for breakpoint and up:
hidden-xs-up=d-none(same ashidden)hidden-sm-up=d-sm-nonehidden-md-up=d-md-nonehidden-lg-up=d-lg-nonehidden-xl-up(n/a 3.x) =d-xl-none
Show/hide only for a single breakpoint:
hidden-xs(only) =d-none d-sm-block(same ashidden-xs-down)hidden-sm(only) =d-block d-sm-none d-md-blockhidden-md(only) =d-block d-md-none d-lg-blockhidden-lg(only) =d-block d-lg-none d-xl-blockhidden-xl(n/a 3.x) =d-block d-xl-nonevisible-xs(only) =d-block d-sm-nonevisible-sm(only) =d-none d-sm-block d-md-nonevisible-md(only) =d-none d-md-block d-lg-nonevisible-lg(only) =d-none d-lg-block d-xl-nonevisible-xl(n/a 3.x) =d-none d-xl-block
Also, note that d-*-block can be replaced with d-*-inline, d-*-flex, d-*-table-cell, d-*-table etc.. depending on the display type of the element. Read more on the display classes



