Skip to content

Instantly share code, notes, and snippets.

View mklasen's full-sized avatar

Marinus Klasen mklasen

View GitHub Profile
@mklasen
mklasen / Instructions.MD
Last active September 21, 2022 02:17
Install wp-cli on shared hosting (Antagonist)

Download WP-CLI

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Test to see if it works correctly

php wp-cli.phar --info

Add extra permissions

@mklasen
mklasen / README.MD
Last active April 25, 2023 13:53
Cloudways restart PHP-FPM via terminal
  1. Create a folder on your server.
  2. Copy the composer.json file
  3. Run composer install
  4. Create a file called restart-php-fpm.php
  5. Set the correct email, key, server ID and php-fpm version.
  6. Run php restart-php-fpm.php
.mphb-reserve-btn-wrapper {
position: relative;
}
.mphb-preloader {
position: absolute;
left: 5px;
top: -23px;
}
FROM ubuntu:18.04
# Update and install software-properties-common (for some reason)
RUN apt update && apt upgrade -y && \
apt-get install software-properties-common -y
# Add repo's (whyuuut)
RUN add-apt-repository ppa:nginx/stable && \
add-apt-repository ppa:jonathonf/ffmpeg-4
# HEAVILY BASED ON: https://github.com/alfg/docker-nginx-rtmp/blob/master/Dockerfile
ARG NGINX_VERSION=1.16.1
ARG NGINX_RTMP_VERSION=1.2.1
ARG FFMPEG_VERSION=4.2.2
ARG IM_VERSION=7.0.10-6
##############################
# Build the NGINX-build image.
@mklasen
mklasen / style.css
Created March 30, 2020 11:50
Het Portaal: CSS Fix voor correcte weergave van advertenties
.advertisement .bsaProItemInner__img {
background-size: contain;
}
@mklasen
mklasen / functions.php
Last active May 13, 2020 17:01
Remove all filters from the_title in the post type is person
<?php
add_action( 'wp', function () {
if ( get_post_type() === 'person' ) {
remove_all_filters( 'the_title' );
}
} );
@mklasen
mklasen / .zprofile
Created March 16, 2020 15:59
MAMP Pro bash profile / .zprofile settings
# Set MAMP's latest PHP version
PHP_VERSION=$(ls /Applications/MAMP/bin/php/ | sort -n | tail -1)
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
# Add support for MYSQL (wp db commands)
export PATH=/Applications/MAMP/Library/bin:$PATH
@mklasen
mklasen / class-sample.php
Last active March 14, 2020 12:26
Add featured image to Latest Posts Block in Block Editor / Gutenberg
<?php
class Sample {
public function __construct() {
$this->hooks();
}
public function hooks() {
// Remove the existing block register function
remove_action( 'init', 'register_block_core_latest_posts', 10 );
@mklasen
mklasen / sympose-overwrite-image-sizes.php
Last active February 25, 2020 05:37
Overwrite Sympose's image sizes
<?php
/**
* Plugin Name: Sympose: Overwrite Image Sizes
*/
add_action('init', function() {
add_image_size( 'person-medium', 150, 150, true );
}, 20);