Skip to content

Instantly share code, notes, and snippets.

View viktorbijlenga's full-sized avatar

Viktor Bijlenga viktorbijlenga

View GitHub Profile
@ostark
ostark / make-auth-json.php
Last active April 16, 2022 10:12
Creates auth.json from ENV vars
<?php
/**
* Example: Oauth with Github token
* php make-auth-json.php github-oauth.github.com GITHUB_TOKEN
*
* Example: Basic auth for private satis repo
* php make-auth-json.php http-basic.nova.laravel.com NOVA_USERNAME NOVA_PASSWORD
*/
// remove script name
@QWp6t
QWp6t / BedrockMultisiteValetDriver.php
Last active March 6, 2024 11:28
Fix Laravel Valet when using WordPress subdirectory multisite + Bedrock
<?php
namespace Valet\Drivers\Custom;
class BedrockMultisiteValetDriver extends \Valet\Drivers\Specific\BedrockValetDriver
{
/**
* Determine if the incoming request is for a static file.
*
* @return string|false
#!/bin/bash
export TERM=xterm;
clear;
echo " ";
echo "---------------------------------------------";
echo " START | "$(date +%m.%d.%Y-%H.%M.%S);
echo "---------------------------------------------";
#create db dump for all databases
@Mte90
Mte90 / php-error-in-wp.php
Last active April 14, 2020 06:09
PHP error in WordPress backend wrapped as native notice. Refer/screenshot on https://core.trac.wordpress.org/ticket/35155
<?php
/*
Plugin Name: Error For WP backend
Plugin URI: https://github.com/Mte90/
Description: Wrap the PHP errors in the WP admin backend with the native notice
Author: Mte90
Version: 1.0.0
*/
@wycks
wycks / image_optimize-wordpress.php
Last active December 16, 2020 01:48
Remove WordPress full size images from being inserted into a post + option to and add max size to to prevent users from inserting massive images.
<?php
/**
*
* This removes the ability to add the FULL image size into a post, it does not alter or delete the image
* Add whataever extra image sizes to the insert dropdown in WordPress you create via add_image_size
*
* For now we have to do it this way to make the labels translatable, see trac ref below.
*
* If your theme has $content_width GLOBAL make sure and remove it
@raideus
raideus / wp-no-image-links.php
Created April 26, 2012 17:35
Stop WordPress from linking images by default
@collegeman
collegeman / youtube-shortcode.php
Created March 6, 2012 17:03 — forked from coreyweb/youtube-shortcode.php
Youtube shortcode for WordPress
<?php
/**
* Youtube Shortcode Solution
*
* Set your desired width for all the videos on your site (below)
* Paste any Youtube video link in the shortcode, using this format, i.e.:
* [youtube value="http://www.youtube.com/watch?feature=player_embedded&v=GGT8ZCTBoBA"]
* This code will automatically resize your video to the appropriate size and aspect ratio.
* Modify the width value (set to 590 here), and the iframe code below to your desired settings.
* This requires coreylib (coreylib.com)
@jakebellacera
jakebellacera / ICS.php
Last active April 19, 2024 09:06
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*