Skip to content

Instantly share code, notes, and snippets.

View jawinn's full-sized avatar

Josh Winn jawinn

View GitHub Profile
@jawinn
jawinn / disable_yoast_xml_pinging.php
Last active October 9, 2018 05:28
Disable Yoast's Automatic XML Sitemap Pinging
<?php
// DISABLE YOAST's AUTOMATIC PINGING OF XML SITEMAP
add_filter('wpseo_allow_xml_sitemap_ping', '__return_false');
?>
@jawinn
jawinn / fobi_states.txt
Last active March 27, 2018 08:32
Django FOBI - List of US States and Territories for Select Menu
AK, Alaska
AL, Alabama
AR, Arkansas
AS, American Samoa
AZ, Arizona
CA, California
CO, Colorado
CT, Connecticut
DC, District of Columbia
DE, Delaware
@jawinn
jawinn / SublimeOnSaveBuild.sublime-settings
Last active February 22, 2018 09:08
Regex to ignore SASS / LESS partials (files starting with underscore) from being built by SublimeOnSaveBuild
// UPDATED VERSION
{
"filename_filter": "(/|\\\\|^)(?!_)(\\w+)\\.(css|js|sass|less|scss)$",
"build_on_save": 1
}
// DEFAULT (for reference, in case you need it back)
{
"filename_filter": "\\.(css|js|sass|less|scss)$",
"build_on_save": 1
@jawinn
jawinn / boostrap-youtube-modal.js
Last active July 20, 2017 03:40
BOOTSTRAP 3.0 - Open YouTube Video Dynamicaly in Modal Window. Allow setting width and height.
// REQUIRED: Include "jQuery Query Parser" plugin here or before this point:
// https://github.com/mattsnider/jquery-plugin-query-parser
$(document).ready(function(){
// BOOTSTRAP 3.0 - Open YouTube Video Dynamicaly in Modal Window
// Modal Window for dynamically opening videos
$('a[href^="http://www.youtube.com"]').on('click', function(e){
// Store the query string variables and values
// Uses "jQuery Query Parser" plugin, to allow for various URL formats (could have extra parameters)
@jawinn
jawinn / appDelegate.m
Created May 24, 2017 13:24
Log font names, React Native
// Add to application in appDelegate.m to log all font names as you would use them in CSS
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@" %@", name);
}
}
@jawinn
jawinn / mono_reset.cs
Last active July 14, 2016 21:46
MonoBehaviour.Reset() Example
private int _jointHealth;
public int startingJointHealth = 2;
// The setter here helps by making sure our health never goes below zero.
private int JointHealth {
get { return _jointHealth; }
set { _jointHealth = Mathf.Max(value, 0); }
}
void Reset(){
JointHealth = startingJointHealth;
}
@jawinn
jawinn / editor_gizmo.cs
Last active July 11, 2016 22:34
Draw Custom Editor Gizmo - Simple
void OnDrawGizmos (){
// In Editor
if (!Application.isPlaying){
// Draw custom gizmo
Gizmos.DrawIcon(transform.position, "spawn_gizmo.png", true);
// Draw yellow box at size of character, for easier placement in level
Gizmos.color = Color.yellow;
Gizmos.DrawWireCube(transform.position, new Vector3(0.8f, 2.0f, 0.8f));
}
}
@jawinn
jawinn / headers_tooltips.cs
Last active July 11, 2016 21:02
Headers and Tooltips in Unity (C#)
[Header("Movement and Speeds")]
[Tooltip("Player speeds, etc")]
public Movement movement;
[Tooltip("Determines maximum jog over time until timeToMaxJog (1.0 is max on curve)")]
public AnimationCurve rampToFullJog = new AnimationCurve(new Keyframe(0,0.1f),new Keyframe(1,1));
[Tooltip("Time in seconds before maximum jog speed is reached")]
public float timeToMaxJog = 2.0f;
@jawinn
jawinn / current_page_share.php
Last active June 1, 2016 20:22
Share Current Page via Facebook
<?php
/**
* Get the current Url taking into account Https and Port
* @link http://css-tricks.com/snippets/php/get-current-page-url/
* @version Refactored by @AlexParraSilva
*/
function getUrl() {
$url = isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';
$url .= '://' . $_SERVER['SERVER_NAME'];
$url .= in_array( $_SERVER['SERVER_PORT'], array('80', '443') ) ? '' : ':' . $_SERVER['SERVER_PORT'];
@jawinn
jawinn / bootstrap_us_states_checkboxes.html
Created May 24, 2016 19:10
50 US States Checkboxes - for Bootstrap 3
<div class="checkbox"><label><input name="regionStates[]" type="checkbox" value="AK">Alaska</label></div>
<div class="checkbox"><label><input name="regionStates[]" type="checkbox" value="AL">Alabama</label></div>
<div class="checkbox"><label><input name="regionStates[]" type="checkbox" value="AR">Arkansas</label></div>
<div class="checkbox"><label><input name="regionStates[]" type="checkbox" value="AZ">Arizona</label></div>
<div class="checkbox"><label><input name="regionStates[]" type="checkbox" value="CA">California</label></div>
<div class="checkbox"><label><input name="regionStates[]" type="checkbox" value="CO">Colorado</label></div>
<div class="checkbox"><label><input name="regionStates[]" type="checkbox" value="CT">Connecticut</label></div>
<div class="checkbox"><label><input name="regionStates[]" type="checkbox" value="DC">District Of Columbia</label></div>
<div class="checkbox"><label><input name="regionStates[]" type="checkbox" value="DE">Delaware</label></div>
<div class="checkbox"><label><input nam