This file contains hidden or 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
// Sensei - Add tags to Courses | |
// Run this after "register_post_type( 'course'..." in "class-woothemes-sensei-posttypes.php" | |
register_taxonomy( | |
'course_tag', | |
'course', | |
array( | |
'hierarchical' => false, | |
'label' => __( 'Tags', CURRENT_THEME ), | |
'singular_name' => __( 'Tag', CURRENT_THEME ), |
This file contains hidden or 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
// Resize Video | |
var video = document.getElementById('video'); | |
$( video ).on('loadeddata', function(event){ | |
scaleToFill( document.getElementById('video') ); | |
}); | |
// Resize Video to Video Tag Dimensions | |
function scaleToFill(videoTag) { | |
var $video = $(videoTag), | |
videoRatio = videoTag.videoWidth / videoTag.videoHeight, |
This file contains hidden or 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 | |
// Use different password if running site locally or on server. | |
// | |
if(in_array($_SERVER['REMOTE_ADDR'], array('localhost', '127.0.0.1'))) { | |
define('DB_PASSWORD', 'rewinded'); // Dev | |
} else { | |
define('DB_PASSWORD', 'HcoWtiebscZU0lTqZt5y'); // Live | |
} |
This file contains hidden or 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
// Returns the colour of a pixel. | |
// ImageUtils.hx | |
import flambe.display.Texture; | |
import haxe.io.Bytes; | |
import haxe.io.BytesData; | |
class ImageUtils | |
{ | |
public static function getPixelColour( x:Float, y:Float, texture:Texture ):Int { |
This file contains hidden or 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
// Checks if a point on a texture hits a pixel with 0 alpha | |
// @th3d0g | |
// ImageUtils.hx | |
import flambe.display.Texture; | |
import haxe.io.Bytes; | |
import haxe.io.BytesData; | |
class ImageUtils |
This file contains hidden or 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
package nl.stroep.games.components; | |
import flambe.Component; | |
import nape.space.Space; | |
/** | |
* @author Mark Knol [blog.stroep.nl] | |
*/ | |
class NapeDebugView extends Component | |
{ | |
private var _space:Space; |
This file contains hidden or 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
var screenScale = 1; | |
window.devicePixelRatio = window.devicePixelRatio || Math.round(screen.deviceXDPI*10 / screen.logicalXDPI)/10; | |
// Calc safe zone for pixels. | |
if( window.devicePixelRatio > 1 ) { | |
var lScreenWidth = Math.max( screen.width, screen.height ) * window.devicePixelRatio; | |
var lScreenHeight = Math.min( screen.width, screen.height ) * window.devicePixelRatio; | |
var SAFE_ZONE_WIDTH = 2048; |
This file contains hidden or 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
/** | |
* Wait until the test condition is true or a timeout occurs. Useful for waiting | |
* on a server response or for a ui change (fadeIn, etc.) to occur. | |
* | |
* @param testFx javascript condition that evaluates to a boolean, | |
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | |
* as a callback function. | |
* @param onReady what to do when testFx condition is fulfilled, | |
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | |
* as a callback function. |
This file contains hidden or 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
// Simulate mouseclick in native JS | |
function simClick( el ){ | |
var event = new MouseEvent('click', { | |
'view': window, | |
'bubbles': true, | |
'cancelable': true | |
}); | |
var canceled = !el.dispatchEvent(event); | |
if (canceled) { |
This file contains hidden or 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
<meta itemprop="name" content="[ TITLE ]" /> | |
<meta itemprop="image" content="[ LISTING IMAGE ]" /> | |
<meta itemprop="description" content="[ ARTICLE DESCRIPTION ]" /> | |
<meta name="description" content="[ ARTICLE DESCRIPTION ]" /> | |
<meta name="author" content="[ AUTHOR FULL NAME ]" /> | |
<meta property="article:author" content="[ GOOGLE+ AUTHOR URL ]" /> | |
<meta property="article:published_time" content="[ PUBLISHED TIMESTAMP ]" /> | |
<meta property="article:section" content="[ CATEGORY ]" /> |