Skip to content

Instantly share code, notes, and snippets.

View simonrcodrington's full-sized avatar

Simon Codrington simonrcodrington

  • Australia
View GitHub Profile
@simonrcodrington
simonrcodrington / Native Drag and Drop - the effectAllowed and the DropEffect properties.markdown
Last active November 9, 2015 13:06
Native Drag and Drop - the effectAllowed and the DropEffect properties

Native Drag and Drop - the effectAllowed and the DropEffect properties

Displaying how the HTML5 Drag and Drop API can be used to control what elements can be dragged and where they can be dropped.

For additional information, please see my corresponding article on SitePoint

A Pen by Simon Codrington

License.

@simonrcodrington
simonrcodrington / Native Drag & Drop - Data transfer on a single page.markdown
Created November 10, 2015 11:16
Native Drag & Drop - Data transfer on a single page

Native Drag & Drop - Data transfer on a single page

Showcasing how to use the native HTML5 Drag and Drop API to move items on a page. Move the different broken up pieces of internet explorer back together to see the message!

A Pen by Simon Codrington on CodePen.

License.

@simonrcodrington
simonrcodrington / Remove_wordpress_cat_tag_archives.txt
Last active October 16, 2017 01:30
Sample function to remove the archive pages from post categories / tags. Useful if you want to disallow access
/**
* Adjusts taxonomies to remove their index page (archive page)
*
* Removing the 'publicly_queryable' property and setting 'rewrite' to false to disallow direct URL linking to the name of the term (no archive page
* needed). requires permalinks once to get this to work.
*
* @param $args - Arguments used to register taxonomy
* @param $taxonomy_name - Taxonomy Key
* @param $object_type - Array of names of object types for the taxonomy
@simonrcodrington
simonrcodrington / WPGDAdminNotice.php
Last active March 22, 2018 06:06
Missing GD PHP Module warning in WordPress Media Settings page
<?php
/**
* Adds a notice to the Media Settings page inside of WP if the GB library is missing
*
* Used to warn the user that no images will be re-sized automatically on upload without the GD library
*/
class WPMissingGDNotice
{
@simonrcodrington
simonrcodrington / readme.md
Last active October 9, 2018 02:20
Getting pthreads working with WAMP CLI on Windows

Getting pthreads working with WAMP CLI

A quick guide on how to get pthreads (parallel threads) working with your local WAMP environment under PHP 7.1~

Issues

Current versions of pthreads wont work with PHP 7.0/7.1, because of issues they've locked use of pthreads to PHP 7.2+ (because of some security issues)

Latest versions of pthreads (3.1.6) wont work with PHP. However, version 3.1.7 beta will work with PHP 7.1/7.2.

@simonrcodrington
simonrcodrington / unity_urp_disabling_volume_components
Last active November 2, 2020 01:02
Unity URP Disabling volume components at run time
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
/// <summary>
/// Unity's URP profile uses 'Volumes' attached to the camera to apply it's new post processing effects.
/// Below is how you can access one of the components(e.g the depth of field component) and disable it at runtime
/// </summary>
class urp_dof_conditional : MonoBehaviour
{
@simonrcodrington
simonrcodrington / Native Drag & Drop - Dragging files directly onto the website.markdown
Created November 10, 2015 10:36
Native Drag & Drop - Dragging files directly onto the website

Native Drag & Drop - Dragging files directly onto the website

Showcases how to use the native API to handle drag and drop elements from external sources (other tabs, other windows, other browsers) and also locally from your machine (via the uploading / writing functionality)

A Pen by Simon Codrington on CodePen.

License.