This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// =============================================================== | |
// Array of countries using the Euro (ISO Alpha-2 country codes). | |
// *As of Jan, 2016. | |
// =============================================================== | |
var euro_users = { | |
// -- EU countries using the euro | |
'AT' : { name: 'Austria' }, | |
'BE' : { name: 'Belgium' }, | |
'CY' : { name: 'Cyprus' }, | |
'EE' : { name: 'Estonia' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// DISABLE YOAST's AUTOMATIC PINGING OF XML SITEMAP | |
add_filter('wpseo_allow_xml_sitemap_ping', '__return_false'); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FIT LAYER TO CANVAS | |
// via https://forums.adobe.com/message/5413957#5413957 | |
var maintainAspectRatio;// set to true to keep aspect ratio | |
if(app.documents.length>0){ | |
app.activeDocument.suspendHistory ('Fit Layer to Canvas', 'FitLayerToCanvas('+maintainAspectRatio+')'); | |
} | |
function FitLayerToCanvas( keepAspect ){// keepAspect:Boolean - optional. Default to false | |
var doc = app.activeDocument; | |
var layer = doc.activeLayer; | |
// do nothing if layer is background or locked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
// Finds the slope/grade/incline angle of ground underneath a CharacterController | |
public class GroundChecker : MonoBehaviour { | |
[Header("Results")] | |
public float groundSlopeAngle = 0f; // Angle of the slope in degrees | |
public Vector3 groundSlopeDir = Vector3.zero; // The calculated slope as a vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private float groundSlopeAngle = 0f; // angle | |
private Vector3 groundSlopeDir; | |
// The controller hits a collider while performing a Move. | |
void OnControllerColliderHit (ControllerColliderHit hit) | |
{ | |
Vector3 temp = Vector3.Cross(hit.normal, Vector3.down); | |
groundSlopeDir = Vector3.Cross(temp, hit.normal); | |
groundSlopeAngle = Vector3.Angle(hit.normal, Vector3.up); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Determing angle of slope underneath character for various purposes. | |
[SerializeField] | |
private float groundSlopeAngle = 0f; // angle | |
private Vector3 groundSlopeDir; | |
private float slopeRaycastLength = 2.0f; | |
private float slopeRaycastSpread = 0.08f; | |
public bool IsSliding() { | |
return groundSlopeAngle > 50 || groundSlopeAngle < -50; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class PlayerController : MonoBehaviour { | |
public float speed = 6.0F; | |
public float gravity = 20.0F; | |
private Vector3 moveDirection = Vector3.zero; | |
public CharacterController controller; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Only show 3rd tier submenu items when under that section! */ | |
.children { | |
display: none; | |
} | |
.current_page_item .children, | |
.current_page_ancestor .children, | |
.current_page_parent .children { | |
display: block; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change "Delivery Notes" to what text you'd like to appear in both locations. | |
// Include other fields in order details | |
function modify_order_details($order){ | |
echo "<p><strong>Delivery Notes:</strong><br>", get_post_meta( $order->id, '_shipping_notes', true ), "</p>"; | |
} | |
add_action( 'woocommerce_admin_order_data_after_shipping_address', 'modify_order_details', 10, 1 ); | |
// Add extra fields to order emails. | |
// This part is via http://docs.woothemes.com/document/add-a-custom-field-in-an-order-to-the-emails/ |