Skip to content

Instantly share code, notes, and snippets.

View DevinWalker's full-sized avatar
🌱
Coding for good

Devin Walker DevinWalker

🌱
Coding for good
View GitHub Profile
/**
* WordPress dependencies
*/
import { createPortal, useEffect, useState } from '@wordpress/element';
import { registerPlugin } from '@wordpress/plugins';
import { Button } from '@wordpress/components';
function MyToolbarButton() {
// Lazy and one time initializations, also gives us a stable reference.
const [ container ] = useState( () => {
@mark123jesper
mark123jesper / Countries.js
Created April 5, 2022 06:54
JS file for Countries with Country code, currency and currency symbol and even flag emoji.
export const listCountries = () => {
return [
{
name: 'Afghanistan',
code: 'AF',
capital: 'Kabul',
region: 'AS',
currency: {
code: 'AFN',
name: 'Afghan afghani',
@ryo-utsunomiya
ryo-utsunomiya / gutenberg.xml
Created December 23, 2017 12:27
PhpStorm setting for Gutenberg Development
<code_scheme name="Gutenberg" version="173">
<HTMLCodeStyleSettings>
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
</HTMLCodeStyleSettings>
<JSCodeStyleSettings>
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
<option name="SPACES_WITHIN_INTERPOLATION_EXPRESSIONS" value="true" />
</JSCodeStyleSettings>
<PHPCodeStyleSettings>
@emgk
emgk / wp-config.php
Created December 11, 2017 06:57
WP Debug Configurations
define('WP_DEBUG', true);
define('SCRIPT_DEBUG',true);
if ( WP_DEBUG ) {
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'log_errors', 'On' );
@ini_set( 'display_errors', 'Off' );
@ini_set( 'error_reporting', E_ALL );
@ini_set( 'error_log', 'php_error.log' );
@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.
@claygriffiths
claygriffiths / resize_local_machine.sh
Last active November 6, 2020 03:45 — forked from joost/resize_boot2docker.sh
Resize Local by Flywheel VirtualBox image
# Steps we will take:
# 1. Change Local (Docker Machine) image type (this will take a bit)
# 2. Resize image
# 3. Resize partion
#
# Also see: https://docs.docker.com/articles/b2d_volume_resize/
# IMPORTANT: Make sure Local is not running!
VM_NAME="local-by-flywheel"
NEW_DISK_SIZE=50000
@chrisdavies
chrisdavies / stripe-currencies.js
Created November 7, 2016 14:53
A handy list of currency codes and descriptions for use with Stripe.
'use strict';
// The STRIPE-supported currencies, sorted by code
export const currencies = [
{
'code':'AED',
'description':'United Arab Emirates Dirham'
},
{
'code':'AFN',
@xeiter
xeiter / unit-testing-with-pressmatic.md
Last active March 16, 2017 01:18 — forked from tommcfarlin/unit-testing-with-pressmatic.md
[WordPress] Unit Testing with Pressmatic

Unit Testing with Pressmatic

  • Updated 20 August 2016

Installing Composer on Pressmatic

  1. SSH into the Pressmatic box
  2. $ apt-get update
  3. $ apt-get install curl php5-cli git subversion
  4. $ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
function recent_donors_function() {
//Get the latest 100 Give Donors
$args = array(
'number' => 100,
function recent_donors_function() {
$donors = Give() - > customers - > get_customers($args);
foreach($donors as $donor) {
@DevinWalker
DevinWalker / give-recurring-dummy-subscriptions.php
Last active December 9, 2015 01:10
This will add child subscription payments to a given subscription
<?php
/**
* Create Recurring Dummy Subscriptions
*/
$subscription = new Give_Subscription( 68 );
$args = array(
'subscription_id' => 68,
'amount' => 20,
'transaction_id' => md5(uniqid(rand(), true)),