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
sudo apt-get install build-essential | |
sudo apt-get install python-dev | |
// Maybe need to install PIP | |
sudo pip install RPi.GPIO |
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
// Grab GET URL variables from JS. | |
// credit: https://css-tricks.com/snippets/javascript/get-url-variables/ | |
function getQueryVariable(variable) | |
{ | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i=0;i<vars.length;i++) { | |
var pair = vars[i].split("="); | |
if(pair[0] == variable){return pair[1];} |
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
// Format seconds to hh:mm:ss. | |
function formatSeconds(seconds) | |
{ | |
var date = new Date(1970,0,1); | |
date.setSeconds(seconds); | |
return date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); | |
} |
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
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
using System.Collections; | |
#if UNITY_IOS | |
using UnityEditor.iOS.Xcode; | |
#endif | |
using System.IO; | |
// PListiOS - Edit the PList file. |
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 | |
// Populate using POST vars | |
$data = [ | |
'email' => '[email protected]', | |
'status' => 'subscribed' | |
]; | |
var_dump( syncMailchimp($data) ); |
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 |
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
// 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
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
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( |