Skip to content

Instantly share code, notes, and snippets.

@CrandellWS
CrandellWS / wp_head_hide_billing_fields_for_registered_users.php
Last active November 22, 2023 00:10 — forked from strangerstudios/wp_head_hide_billing_fields.php
Hide Paid Memberships Pro billing address fields and make them optional. Meant to be used with the Braintree gateway.
add_action('pmpro_checkout_before_submit_button', 'my_pmp_jquery');
function my_pmp_jquery() {
global $current_user;
get_currentuserinfo();
if ($current_user->user_login) {
//script will hide billing fields and prefill name and email from WP account
?>
<script>
jQuery( document ).ready(function($) {
@CrandellWS
CrandellWS / html2canvas.js
Last active September 14, 2023 20:17
html2canvas cors & cache workaround
/*!
* html2canvas 1.0.0-alpha.12-rc2 <https://html2canvas.hertzen.com>
* Copyright (c) 2018 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
* Editted By William Crandell
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
@CrandellWS
CrandellWS / Paintable.cs
Last active March 20, 2023 03:41 — forked from ditzel/Paintable.cs
Drawing Canvas
using System.Collections;
using System.IO;
using UnityEngine;
using UnityEngine.InputSystem;
public class SignatureCapture : MonoBehaviour
{
[SerializeField] private GameObject brushPrefab;
[SerializeField] private float brushSize = 0.1f;
[SerializeField] private RenderTexture renderTexture;
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
if (isset($_POST['dbhost'])) {
preg_match( '/^((?!-)[a-z0-9-]{1,63}(?<!-)(\.){0,1})+([a-z]{0,9})(?<!\.)((;port=){1}[0-9]{2,6}){0,1}$/i', $_POST['dbhost'], $matches);
echo "<pre>".print_r($matches, true)."</pre>";
die();
$DB_HOST = $_POST['dbhost'];
$DB_DATABASE = $_POST['dbname'];
$DB_USERNAME = $_POST['dbuser'];
@CrandellWS
CrandellWS / Drive.php
Created June 25, 2022 20:43 — forked from bshaffer/Drive.php
Google Drive API (v3) - PHP
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@CrandellWS
CrandellWS / README.md
Last active April 12, 2021 10:39 — forked from robschmuecker/README.md
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@CrandellWS
CrandellWS / debug-CustomMultiDexApplication.java
Created February 27, 2020 02:22 — forked from akhgupta/debug-CustomMultiDexApplication.java
leakcanary-android-no-op - Class,Method not found solution
// app/src/debug/java/com/akhil/sampleapp/CustomMultiDexApplication.java
package com.akhil.sampleapp;
import android.support.multidex.MultiDexApplication;
import com.squareup.leakcanary.AndroidExcludedRefs;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
@CrandellWS
CrandellWS / README.md
Last active March 14, 2019 23:04
Movie Trailer Page example
@CrandellWS
CrandellWS / README.md
Created January 10, 2019 12:02 — forked from JohannesMP/LICENSE
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.

What is this?

A SceneReference wrapper class that uses ISerializationCallbackReceiver and a custom PropertyDrawerto provide safe, user-friendly scene references in scripts.

![alt text][1]

Why is this needed?