Skip to content

Instantly share code, notes, and snippets.

View newactual's full-sized avatar

Frank K-a newactual

  • Gold Coast
  • 16:26 (UTC)
View GitHub Profile
@abobija
abobija / wsl2-ubuntu-lamp.md
Last active July 10, 2024 14:21
LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

Apache

sudo apt-get update && sudo apt-get upgrade 
sudo apt-get install -y apache2

PHP

@wazum
wazum / aspect_ratio.php
Last active October 26, 2023 13:41
PHP Calculate aspect ratio from width and height
<?php
function getAspectRatio(int $width, int $height)
{
// search for greatest common divisor
$greatestCommonDivisor = static function($width, $height) use (&$greatestCommonDivisor) {
return ($width % $height) ? $greatestCommonDivisor($height, $width % $height) : $height;
};
$divisor = $greatestCommonDivisor($width, $height);
@nmsmith22389
nmsmith22389 / MySQL Data Types Cheat Sheet.md
Last active May 16, 2024 09:50
A cheat sheet for all MySQL data types and what they do.

MySQL: Data Types

The following is a list of datatypes available in MySQL, which includes string, numeric, date/time, and large object datatypes.

String Datatypes

The following are the String Datatypes in MySQL:

Data Type Syntax Maximum Size Explanation
@sajdoko
sajdoko / Theme_Customization_API.php
Created June 26, 2018 15:46
Wordpress Customizer API Sanitization Examples
<?php
///////////////////////////////
// HOW TO SANITIZE RADIO BOX //
///////////////////////////////
function theme_slug_customizer($wp_customize) {
//your section
$wp_customize->add_section(
'theme_slug_customizer_your_section',
array(
'title' => esc_html__('Your Section', 'theme_slug'),
@dvlop
dvlop / gist:fca36213ad6237891609e1e038a3bbc1
Last active July 22, 2024 14:45 — forked from allthingsdem/gist:63b3223a7d14ac1f2457
My long list of bad bots to block in htaccess, ready to copy and paste!
# Start Bad Bot Prevention
<IfModule mod_setenvif.c>
# SetEnvIfNoCase User-Agent ^$ bad_bot
SetEnvIfNoCase User-Agent "^12soso.*" bad_bot
SetEnvIfNoCase User-Agent "^192.comAgent.*" bad_bot
SetEnvIfNoCase User-Agent "^1Noonbot.*" bad_bot
SetEnvIfNoCase User-Agent "^1on1searchBot.*" bad_bot
SetEnvIfNoCase User-Agent "^3D_SEARCH.*" bad_bot
SetEnvIfNoCase User-Agent "^3DE_SEARCH2.*" bad_bot
SetEnvIfNoCase User-Agent "^3GSE.*" bad_bot
@amboutwe
amboutwe / yoast_seo_dashboard_widget_remove.php
Last active November 16, 2023 00:43
Remove Yoast SEO Dashboard Widget
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Dashboard Widget
* Credit: Unknown
* Last Tested: Sep 15 2022 using Yoast SEO 19.6.1 on WordPress 6.0.2
*/
add_action('wp_dashboard_setup', 'remove_wpseo_dashboard_overview' );
@nicolasdao
nicolasdao / open_source_licenses.md
Last active July 21, 2024 20:51
What you need to know to choose an open source license.
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active July 23, 2024 14:54
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@amboutwe
amboutwe / yoast_seo_opengraph_change_image_size.php
Last active June 3, 2024 18:39
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change size for Yoast SEO OpenGraph image for all content
* Credit: Yoast Development team
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail'
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/
*/