Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Codrington simonrcodrington

  • Australia
View GitHub Profile
@simonrcodrington
simonrcodrington / unity_urp_disabling_volume_components
Last active Nov 2, 2020
Unity URP Disabling volume components at run time
View unity_urp_disabling_volume_components
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 / readme.md
Last active Oct 9, 2018
Getting pthreads working with WAMP CLI on Windows
View readme.md

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 / WPGDAdminNotice.php
Last active Mar 22, 2018
Missing GD PHP Module warning in WordPress Media Settings page
View WPGDAdminNotice.php
<?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 / Remove_wordpress_cat_tag_archives.txt
Last active Oct 16, 2017
Sample function to remove the archive pages from post categories / tags. Useful if you want to disallow access
View Remove_wordpress_cat_tag_archives.txt
/**
* 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
View Native Drag & Drop - Data transfer on a single page.markdown

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 / Native Drag & Drop - Dragging files directly onto the website.markdown
Created Nov 10, 2015
Native Drag & Drop - Dragging files directly onto the website
View Native Drag & Drop - Dragging files directly onto the website.markdown

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.

@simonrcodrington
simonrcodrington / Native Drag and Drop - the effectAllowed and the DropEffect properties.markdown
Last active Nov 9, 2015
Native Drag and Drop - the effectAllowed and the DropEffect properties
View Native Drag and Drop - the effectAllowed and the DropEffect properties.markdown

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.