Skip to content

Instantly share code, notes, and snippets.

View danmaby's full-sized avatar

Dan Maby danmaby

View GitHub Profile
@danmaby
danmaby / jitsi-meet-multi-server.md
Last active April 3, 2022 16:50
This tutorial is for jitsi-meet installation using 2 server or more. The main server will contain jitsi-meet react source code, prosody, nginx, and jicofo. The videobridge will be installed seperatelly on the second server and so on.

How to Install Jitsi Meet with Multi Server Configuration

This tutorial is for jitsi-meet installation using 2 server or more. The main server will contain jitsi-meet react source code, prosody, nginx, and jicofo. The videobridge will be installed seperatelly on the second server and so on.

Prerequisite

  1. Minimum 2 servers with 1 IP Public each
  2. Ubuntu 18.04

Sudo Privileges

Before starting make sure there are no permission issues on the installation.

@danmaby
danmaby / restart-jitsi.bash
Created June 19, 2020 08:54
Restart Jitsi Meet
sudo systemctl restart prosody
sudo systemctl restart jicofo
sudo systemctl restart jitsi-videobridge2
sudo systemctl restart nginx
@danmaby
danmaby / functions.php
Created October 5, 2019 17:22
Populate GiveWP fields via query string
// Hooking into the single form view.
add_action( 'give_post_form_output', 'give_populate_amount_name_email' );
function give_populate_amount_name_email() {
?>
<script>
// use an enclosure so we don't pollute the global space
(function(window, document, $, undefined){
@danmaby
danmaby / functions.php
Last active October 10, 2018 19:10
Exclude products from a particular category on the shop page (WooCommerce)
<?php
/**
* Exclude products from a particular category on the shop page
*/
function custom_pre_get_posts_query( $q ) {
$tax_query = (array) $q->get( 'tax_query' );
$tax_query[] = array(
@danmaby
danmaby / decorative-wrap.css
Created August 1, 2018 08:06
Polished Mobile Nails Decorative Wrap CSS
/* Decorative wrap -----*/
.wrap-default, .decorative-wrap-1, .decorative-wrap-2, .decorative-wrap-3, .decorative-wrap-4 {
position: relative;
z-index: 1;
display: inline-block;
}
@media (min-width: 992px) {
.wrap-default, .decorative-wrap-1, .decorative-wrap-2, .decorative-wrap-3, .decorative-wrap-4 {
display: block;
}
@danmaby
danmaby / functions.php
Created June 9, 2018 08:21
default editor label for my_custom_post_type
<?php
// default editor label for my_custom_post_type
add_action('admin_footer', 'add_title_to_editor');
function add_title_to_editor() {
global $post;
if (get_post_type($post) == 'my_custom_post_type') : ?>
<script> jQuery('<h3>Optional Additional Information</h3>').insertBefore('#postdivrich'); </script>
<? endif;
@danmaby
danmaby / keybase.md
Created May 23, 2018 18:11
keybase.md

Keybase proof

I hereby claim:

  • I am danmaby on github.
  • I am danmaby (https://keybase.io/danmaby) on keybase.
  • I have a public key ASB3Cx53jUDppwLxpkgEu4wlmRg7rQstfeTSe8SabKk_iwo

To claim this, I am signing this object:

@danmaby
danmaby / functions.php
Created April 4, 2018 09:37
Replace og:image on custom post type archive
<?php
// CPT Talks - replace og:image
add_action( 'wp_head', 'prefix_add_og_image', 10, 1 );
function prefix_add_og_image( $img ) {
if( is_post_type_archive( 'post-type-archive-wpldn_talk' ) ) {
echo '<meta property="og:image" content="https://www.wpldn.uk/wp-content/uploads/2018/03/2018-02-22-WPLDN_Primary-Image-2.jpg" />';
}
}
@danmaby
danmaby / functions.php
Last active March 30, 2018 16:44
Remove "Archives:" from WP Astra Advanced Header Add-on
<?php
// Filter out "archive" from archive page title
function wpldn_remove_archive_text( $value, $original_value, $params ) {
$value = str_replace( $params->'Archives: ', ' ', $value );
return $value;
}
add_filter( 'ast-advanced-headers-title', 'wpldn_remove_archive_text', 10, 3 );
@danmaby
danmaby / functions.php
Last active February 19, 2018 11:56
Add custom post types to WordPress loop
<?php
/**
* Add 'Events' CTP to WP Loop
**/
function add_custom_post_type_to_query( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'post_type', array('post', 'events') );
}
}