Skip to content

Instantly share code, notes, and snippets.

View schuhwerk's full-sized avatar

Vitus Schuhwerk schuhwerk

View GitHub Profile
@schuhwerk
schuhwerk / convert-myisam-to-innodb.sh
Last active March 5, 2021 20:02
Convert tables (WordPress) to innodb. Run multiple at once...
#!/usr/bin/env bash
# Original Author Mike https://guides.wp-bullet.com
# Edited by Vitus Schuhwerk
# Purpose - Convert MyISAM tables to InnoDB with WP-CLI
# You can run multiple instances of this like this:
# - "bash scriptname 4 0" convert tables 0, 4, 8, ...
# - "bash scriptname 4 1" convert tables 1, 5, 9, ...
# - "bash scriptname 4 2" convert tables 2, 6, 10, ...
# - "bash scriptname 4 3" convert tables 3, 7, 11, ...
@schuhwerk
schuhwerk / composer.json
Created February 13, 2021 22:13
More comoser dependencies spaces.vs.digital
{
"name": "spaces/more-composer-dependencies",
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"require": {
"wpackagist-plugin/acf-to-rest-api": "3.*",
@schuhwerk
schuhwerk / composer.json
Last active December 7, 2020 15:23
This is a composer file for testing...
{
"name": "spaces/more-composer-dependencies",
"require": {
"psr/container": "^1.0"
}
}
@schuhwerk
schuhwerk / timing things.php
Last active November 26, 2018 18:34
first draft of endlessly recurring datespans optimised for querying...
<?php
namespace Spaces;
require dirname( __DIR__ ) . '/vendor/autoload.php';
/**
* @see https://github.com/smhg/date-timespan-php
*/
use Timespan\Timespan;
@schuhwerk
schuhwerk / setcookie_samesite_polyfill.php
Last active October 15, 2021 15:04 — forked from bohwaz/setcookie_samesite_polyfill.php
PHP setcookie function polyfill with support for SameSite attribute (compatible with PHP 5.0+)
<?php
/**
* Setcookie function with support for SameSite
* @param string|null $samesite 'Lax' or 'Strict'
*/
function setcookie_samesite( $name, $value = '', $expire = 0, $path = null, $domain = null, $secure = false, $httponly = false, $samesite = null)
{
$header = 'Set-Cookie: '.rawurlencode($name) . '=' . rawurlencode($value).';';
$header .= $expire ? sprintf('expires=%s', gmdate('D, d M Y H:i:s \G\M\T', $expire)).'; ' : '';
@schuhwerk
schuhwerk / font-awesome-4.7.0.json
Last active January 12, 2022 22:22 — forked from zwinnie/font-awesome-4.7.0.json
JSON Of Font Awesome 4.7.0 Icons (That don't collide with UI-Elements)
{
"4.7.0": [
"fa-500px",
"fa-address-book",
"fa-address-book-o",
"fa-address-card",
"fa-address-card-o",
"fa-adjust",
"fa-adn",
"fa-align-center",
@schuhwerk
schuhwerk / flatpickr php date.js
Created February 28, 2018 12:21
Use a variable PHP datestring to format a date in Javascript
/**
* Localize a Datepicker / Timepicker (flatpickr)
* Format PHP datestring to js and vice versa
*
* fromPhp is the variable that gets passed via wordpress wp_localize_script
* fromPhp.dateFormat get_option( 'date_format' );
* fromPhp.timeFormat get_option( 'time_format' );
*/
//https://github.com/kartik-v/php-date-formatter
Platzhalter in {} sind zu ersetzen!
Externer Link über die Schaltfläche des ILIAS-Editors. Link öffnet sich in neuem Fenster/Tab, je
nach Browser-Einstellung des Users:
[xln url="{URL des Space}"]{anzuzeigender Text}[/xln]
Beispiel:
[xln url="https://llc.th-koeln.de/ipk/"]Space: Interne Projektkoordination[/xln]
@schuhwerk
schuhwerk / sample-plugin.php
Created October 2, 2017 16:00
A simple sample plugin / template plugin / demo plugin (mostly without Settings API) which creates a * Settings page in a Wordpress Network (WPMU).
<?php
/**
* Plugin Name: My Plugin
* Plugin URI:
* Description: A simple sample plugin / template plugin / demo plugin (mostly without Settings API) which creates a
* Settings page in a Wordpress Network (WPMU).
* Replace 'my_plugin' and 'my-plugin' with something that makes sense to you and you are set
* Regex: replace my(.)plugin with really$1nice
* Add some settings to default_settings (use underscores for values) and add descriptions in $this->decriptions
* If you want a custion form-field: your_setting_form_callback($name, $value, $description)
@schuhwerk
schuhwerk / image-list.txt
Created March 28, 2017 15:06
A list of images from lormpixel
http://lorempixel.com/400/200/abstract/0
http://lorempixel.com/400/200/abstract/1
http://lorempixel.com/400/200/abstract/2
http://lorempixel.com/400/200/abstract/3
http://lorempixel.com/400/200/abstract/4
http://lorempixel.com/400/200/abstract/5
http://lorempixel.com/400/200/abstract/6
http://lorempixel.com/400/200/abstract/7
http://lorempixel.com/400/200/abstract/8
http://lorempixel.com/400/200/abstract/9