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
// 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
<?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
// 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
// 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
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' ); | |
function custom_pre_get_posts_query( $q ) { | |
if ( ! $q->is_main_query() ) return; | |
if ( ! $q->is_post_type_archive() ) return; | |
if ( ! is_admin() && is_shop() ) { | |
$q->set( 'tax_query', array(array( |
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
Debug: | |
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64 | |
Release: | |
keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64 |
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
// Fix; check mime type without FileInfo extension. | |
if (function_exists('finfo_file')) { | |
$mime = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path); | |
} else { | |
$infFil=getimagesize($path); | |
$mime = $infFil["mime"]; | |
} |
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
// Load either live or dev .env | |
(new Dotenv\Dotenv(__DIR__.'/../', ( strpos( gethostname(), 'liveserver.com' ) !== false ) ? '.env.live' : '.env' ) )->load(); |
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
///////////////////// | |
// Use ADB over WIFI. | |
///////////////////// | |
// Run ADB commands (e.g. logcat) with your device connect via WIFI rather than USB. | |
// Note; Can be slow to push/install larger APK files. | |
// 1. Set port. | |
adb tcpip 5555 |