This file contains 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
#! /bin/bash | |
# | |
# Diffusion youtube avec ffmpeg | |
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée. | |
VBR="2500k" # Bitrate de la vidéo en sortie | |
FPS="30" # FPS de la vidéo en sortie | |
QUAL="medium" # Preset de qualité FFMPEG | |
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube |
This file contains 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
import config from '../config' | |
let components = {} | |
//For each component in the config fiel into an object | |
for (var i = config.length - 1; i >= 0; i--) { | |
components[config[i].name] = require(config[i].path).default | |
} | |
export default components |
This file contains 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 | |
/** | |
* Insert an attachment from an URL address. | |
* | |
* @param String $url | |
* @param Int $post_id | |
* @param Array $meta_data | |
* @return Int Attachment ID | |
*/ |
This file contains 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
/** | |
* Finds last working/business day of the month. | |
* | |
* Not tested for cross-browser compability. Works in Node.js though. | |
* | |
* EXAMPLES: | |
* | |
* 1. Returns last day of the last month of the current year: | |
* | |
* var result = lastBusinessDayOfMonth(); |
This file contains 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 | |
/** | |
* Force enable a plugin. | |
* | |
* @param array $plugins | |
* | |
* @return array | |
*/ | |
add_filter( 'option_active_plugins', function ( $plugins ) { |
This file contains 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( 'wp_ajax_button_click', 'user_clicked' ); | |
function user_clicked() { | |
update_user_meta( get_current_user_id(), 'clicked_link', 'yes' ); | |
wp_redirect( $_SERVER['HTTP_REFERER'] ); | |
exit(); | |
} |