Skip to content

Instantly share code, notes, and snippets.

@CrandellWS
CrandellWS / Android Privacy Policy Template
Created February 9, 2018 17:16 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@CrandellWS
CrandellWS / DynamicLayoutGroup.cs
Created February 15, 2018 01:13 — forked from robertwahler/DynamicLayoutGroup.cs
Unity 3D layout group switches orientation automatically between landscape and portrait layouts so it either acts like a VerticalLayoutGroup or a HorizontalLayoutGroup.
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;
using System.Collections.Generic;
using SDD.Extensions;
using SDD.Events;
namespace SDD.UI {
@CrandellWS
CrandellWS / DynamicLayoutGroup.cs
Created February 15, 2018 01:13 — forked from robertwahler/DynamicLayoutGroup.cs
Unity 3D layout group switches orientation automatically between landscape and portrait layouts so it either acts like a VerticalLayoutGroup or a HorizontalLayoutGroup.
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;
using System.Collections.Generic;
using SDD.Extensions;
using SDD.Events;
namespace SDD.UI {
/*
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' );
@CrandellWS
CrandellWS / gist:d5e7fca862f7d035ab67c2c2cc45407e
Created August 27, 2018 02:32 — forked from olimortimer/gist:3032672
JS: jQuery Replace HREF Query String
// www.website.com/page?id=100
$('#pageLink').attr('href', $('#pageLink').attr('href').replace(/((\?|&)id\=)[0-9]*/, '$1' + '123'));
// www.website.com/page?id=123
@CrandellWS
CrandellWS / CenterCropDrawable.java
Created September 27, 2018 13:11 — forked from rudchenkos/CenterCropDrawable.java
Maintain aspect ratio of bitmap drawables set as windowBackground on Android
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 / 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?

@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 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 / 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
*