Skip to content

Instantly share code, notes, and snippets.

@keesiemeijer
keesiemeijer / setup-phpunit.sh
Last active December 8, 2023 11:02
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1

Git Cheat Sheet

Commands

Getting Started

git init

or

@pyronaur
pyronaur / gist:5387539
Last active October 2, 2019 11:13
sanitize_html_class works just fine for a single class But sometimes le wild `<span class="blue hedgehog">` appears, which is when you need this function, to validate both blue and hedgehog, Because sanitize_html_class doesn't allow spaces (because it's meant for a single class)
<?php
if ( ! function_exists( "sanitize_html_classes" ) && function_exists( "sanitize_html_class" ) ) {
/**
* sanitize_html_class works just fine for a single class
* Some times le wild <span class="blue hedgehog"> appears, which is when you need this function,
* to validate both blue and hedgehog,
* Because sanitize_html_class doesn't allow spaces.
*
* @uses sanitize_html_class