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
<?php | |
// ADD NEW ADMIN USER TO WORDPRESS | |
// ---------------------------------- | |
// Put this file in your Wordpress root directory and run it from your browser. | |
// Delete it when you're done. | |
require_once('wp-blog-header.php'); | |
require_once('wp-includes/registration.php'); | |
// ---------------------------------------------------- |
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
/* | |
https://www.w3.org/TR/css-content-3/#alt | |
Support: https://caniuse.com/mdn-css_properties_content_alt_text | |
This particular element is presentational only, so an empty string | |
is used so that the symbol is not read by a screen reader. | |
*/ | |
&:before { | |
content: "{" / ""; | |
} |
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 | |
/** | |
* Get the Yoast primary category from its post meta value, and displays it, with HTML markup. | |
* If there is no primary category set, it displays the first assigned category. | |
* | |
* @param boolean $useCatLink Whether to link the category, if it exists | |
* @return void | |
*/ | |
function yourtheme_display_yoast_primary_category( $useCatLink = true ) { |
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
/// <summary> | |
/// You would not believe what amazing things this method does. | |
/// </summary> | |
/// <param name="exampleInteger">A explanation of this really important number </param> | |
public static void DoSomething(int exampleInteger){} |
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
/** | |
* Add horizontal scrollbar to TOP of WPDataTables, when scrolling is enabled. | |
* Useful if the number of visible rows is large, because otherwise you can't access | |
* the whole table unless you scroll to the very bottom to use the scrollbar. | |
*/ | |
window.addEventListener('load', function(){ | |
/** | |
* Add additional horizontal scrollbar to top of an element. | |
* Inserts a "dummy" div above the element that has horizontal scrolling, then syncs scrolling between the two. | |
* * Based on stackoverflow answer: https://stackoverflow.com/a/56952952/835996 |
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
<div class="percentbar" style="width:<?php echo round(100 * $scale); ?>px;"> | |
<div style="width:<?php echo round($percent * $scale); ?>px;"></div> | |
</div> | |
Percentage: <?php echo $percent; ?>% |
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 | |
/** | |
* Add additional 'download-count' column to the table of downloads on the customer's order email. | |
* @param Array $columns Associative array of key "column_id" and value with the display name https://goo.gl/TDxPLE | |
*/ | |
function add_order_email_dl_cols($columns) { | |
return array( | |
'download-product' => __( 'Product', 'woocommerce' ), | |
'download-expires' => __( 'Expires', 'woocommerce' ), |
NewerOlder