Skip to content

Instantly share code, notes, and snippets.

View foliovision's full-sized avatar

Alec Kinnear foliovision

View GitHub Profile
@foliovision
foliovision / fv-player-memberpress-courses-fix.php
Last active March 31, 2022 14:44
FV Player - fix for MemberPress Courses as it doesn't run with wp_footer()
<?php
/*
* Plugin Name: FV Player - MemberPress Courses fix
* Version: 0.2
* Description: Since memberpress-courses/app/views/classroom/courses_footer.php doesn't contain wp_footer hook we have to provide an alternative way of loading FV Player scripts. Here's another description of the issue: https://blog.calendarscripts.info/watu-watupro-and-memberpress-temporary-solution-to-an-issue/
* Author: Foliovision
* Author URI: https://foliovision.com
*/
@foliovision
foliovision / fv-player-handle-video-tags.php
Last active May 10, 2021 09:47
FV Player Bridge for HTML video tags
<?php
/*
Plugin Name: FV Player - Handle video tags
Description: Changes any <video> tag to FV Player
Author: Foliovision
Version: 0.2
Author URI: https://foliovision.com
*/
@foliovision
foliovision / fv-player-custom-cdn.php
Created May 5, 2021 21:06
Add another CDN for FV Player Pro with custom URL token generator
<?php
/*
Plugin Name: FV Player Pro - Custom CDN
Description: Add Settings -> FV Player Pro -> Hosting -> BunnyCDN Extended which signs the URLs for use in SK and US countries only.
Author: Foliovision
Version: 0.1
*/
add_action( 'plugins_loaded', 'fv_player_custom_cdn_load', 0 );
var player = jQuery('<div id="background-video"></div>');
jQuery('#wp-custom-header').append(player);
player.flowplayer( {
autoplay: true,
disabled: true,
loop: true,
clip:
{
"sources": [
{ src: "https://s3-eu-west-1.amazonaws.com/fv-player-unprotected/dominika-960-31_HD.mp4", type: "video/mp4" }
@foliovision
foliovision / wp_is_mobile-wp-rocket.php
Created February 20, 2020 14:07
Make wp_is_mobile() use WP Rocket mobile detection
<?php
/*
Core WordPress function wp_is_mobile() detects iPad as mobile, so we filter it and use WP Rocket mobile detection
*/
add_filter( 'wp_is_mobile', 'fv_bra_wp_is_mobile' );
function fv_bra_wp_is_mobile( $is_mobile ) {
if ( class_exists( 'Rocket_Mobile_Detect' ) ) {
$detect = new Rocket_Mobile_Detect();
@foliovision
foliovision / FV Player unload on magnificPopup closing.js
Created February 2, 2018 12:26
FV Player unload on magnificPopup closing
jQuery(document).on('mfpClose', function() {
jQuery('.flowplayer').data('flowplayer').unload()
} );
@foliovision
foliovision / set-up-secure-mac.md
Last active March 10, 2023 16:42
How to Set Up a Mac Securely for OS X Sierra

Securing the Computer

  1. don't plug in to internet
  2. chose a country (United Kingdom)
  3. refuse to share any info with apple or log in to iCloud (to make sure you don't get sucked in early)
  4. refuse location services
  5. restart
  6. still a German computer
    1. add a new language in Regions preferences
    2. some dialogues (restarting) still come in German after deleting German
<?php
add_action( 'wp_enqueue_scripts', 'tweak_fv_player_css_enqueue' );
function tweak_fv_player_css_enqueue() {
global $fv_fp;
if( method_exists( $fv_fp, 'css_enqueue' ) {
$fv_fp->css_enqueue(true);
}
}
@foliovision
foliovision / bbpress-conversion-clean-up.php
Created May 24, 2016 14:50
bbPress 1 to bbPress 2 cleanup tool
<?php
/*
Please read the bbPress 1 conversion article on foliovision.com before using
*/
include('wp-load.php');
global $wpdb;
$aPosts = $wpdb->get_results( "SELECT * FROM $wpdb->posts AS p JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type IN ('forum','topic','reply') AND ( meta_key = '_bbp_old_topic_id' ) LIMIT 10000 " );
@foliovision
foliovision / bbpress-fix-post-position.php
Created May 24, 2016 14:45
Fix bbPress 1 post positions
<?php
include('bb-load.php');
global $bbdb;
$aTopics = $bbdb->get_col( "SELECT topic_id FROM $bbdb->topics" );
foreach( $aTopics AS $iTopic ) {
echo $iTopic.'<br />';
bb_update_post_positions($iTopic);
}