Skip to content

Instantly share code, notes, and snippets.

William Crandell CrandellWS

Block or report user

Report or block CrandellWS

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@CrandellWS
CrandellWS / html2canvas.js
Last active May 15, 2019
html2canvas cors & cache workaround
View html2canvas.js
/*!
* 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 / README.md
Last active Mar 14, 2019
Movie Trailer Page example
View README.md
@CrandellWS
CrandellWS / README.md
Created Jan 10, 2019 — forked from JohannesMP/LICENSE
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
View README.md

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?

View CustomInAppKeyboard.java
public class CustomInAppKeyboard extends LinearLayoutCompat {
private static final String TAG = "MyKeyboard";
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if(BuildConfig.DEBUG){
Log.e("CustomInAppKeyboard", "w:" + widthMeasureSpec + " :: " + MeasureSpec.toString(widthMeasureSpec));
@CrandellWS
CrandellWS / CenterCropDrawable.java
Created Sep 27, 2018 — forked from rudchenkos/CenterCropDrawable.java
Maintain aspect ratio of bitmap drawables set as windowBackground on Android
View CenterCropDrawable.java
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@CrandellWS
CrandellWS / wp_head_hide_billing_fields_for_registered_users.php
Last active Aug 31, 2018 — 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.
View wp_head_hide_billing_fields_for_registered_users.php
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 / gist:d5e7fca862f7d035ab67c2c2cc45407e
Created Aug 27, 2018 — forked from olimortimer/gist:3032672
JS: jQuery Replace HREF Query String
View gist:d5e7fca862f7d035ab67c2c2cc45407e
// www.website.com/page?id=100
$('#pageLink').attr('href', $('#pageLink').attr('href').replace(/((\?|&)id\=)[0-9]*/, '$1' + '123'));
// www.website.com/page?id=123
View my_pmpro_how_hear_field.php
/*
Add a "How did you hear about us?" field Membership Checkout for new members only.
Display the field for admins-only in the profile and in the Members List CSV export.
*/
function my_pmpro_how_hear_fields() {
global $current_user;
if(class_exists( 'PMProRH_Field' ) && (!pmpro_hasMembershipLevel() || current_user_can( 'edit_users' ) ) ) {
pmprorh_add_checkout_box( 'additional', 'Additional Information' );
View AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ws.crandell.simplekeyboard">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<service android:name=".SimpleIME"
You can’t perform that action at this time.