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
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew | |
chmod +x phpbrew | |
# Move phpbrew to somewhere can be found by your $PATH | |
sudo mv phpbrew /usr/bin/phpbrew | |
phpbrew ext install gd \ | |
-- --with-libdir=lib/i386-linux-gnu \ | |
--with-gd=shared \ | |
--enable-gd-native-ttf \ |
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 | |
add_filter( 'acf/load_field/name=flex_layout', __CLASS__ . '::craft_content_layouts' ); | |
static function craft_content_layouts( $field ) { | |
// Remove the layouts | |
// that are named in this list | |
$remove_list = [ | |
'paragraph', | |
'banner', |
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
{ | |
"name": "new_project", | |
"type": "project", | |
"authors": [ | |
{ | |
"name": "Andrew smith", | |
"email": "[email protected]" | |
} | |
], | |
"repositories": [ |
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 | |
add_action( 'init', function() { | |
ini_set( 'memory_limit', '2048M' ); | |
set_time_limit( 0 ); | |
$posts = get_posts( [ | |
'post_type' => 'product', | |
'posts_per_page' => -1 | |
] ); | |
$count = 0; |
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 | |
function display_product_colors() { | |
$colors = array(); | |
$options = get_post_meta(get_the_ID(), '_swatch_type_options', true); | |
foreach($options as $option) { | |
foreach($option as $item) { | |
foreach($item as $att) { | |
$colors[] = $att['color']; | |
} |
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 | |
static function show_all_available_colour_options() { | |
global $product; | |
// Only variations | |
if ( ! $product->is_type( 'variable' ) ) { | |
return; | |
} |
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
# Connect to wifi | |
nmcli device wifi list | |
sudo nmcli device wifi connect 'rasperrypi' ifname wlan0 | |
nmcli device status | |
# Update device | |
sudo apt-get update && sudo apt-get upgrade | |
# Set language | |
sudo apt-get update && sudo apt-get install locales && sudo dpkg-reconfigure locales && sudo locale-gen | |
# Install depends | |
sudo apt-get install python2.7 libusb-1.0 python-numpy python-opencv ca-certificates unzip ssh |
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 | |
/** | |
* How to rearrange your header when using Craft | |
*/ | |
class craft_headers { | |
// Load classes before | |
static function setup(){ | |
add_action( 'init', __CLASS__ . '::cleanup', 10 ); | |
add_action( 'init', __CLASS__ . '::reshuffle', 20 ); |
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
# Build your SD card with PiFiler | |
# Mount ROOT on your MacOS | |
# Open config.txt and place this at the bottom | |
dtoverlay=dwc2 | |
# Save and open cmdline.txt | |
# find rootwait and add this after | |
modules-load=dwc2,g_ether | |
# On MacOS, head to settings |
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
# Install everything needed | |
sudo apt-get install -y python-setuptools python-dev build-essential mplayer | |
# Install PIP | |
sudo easy_install pip | |
# PIP Pyradio | |
pip install pyradio | |
# If you get permission errors, try `sudo pip install pyradio` |