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( 'oembed_result', 'fwe_oembed_result', 10, 3 ); | |
| function fwe_oembed_result( $result, $url, $args ){ | |
| //Uebernommen aus wp-includes/class-oembed.php | |
| //L38ff | |
| $youtube_regex = array( | |
| '#http://((m|www)\.)?youtube\.com/watch.*#i', | |
| '#https://((m|www)\.)?youtube\.com/watch.*#i', | |
| '#http://youtu\.be/.*#i', | |
| '#https://youtu\.be/.*#i', |
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 | |
| /** | |
| * Filter a few parameters into YouTube oEmbed requests | |
| * | |
| * @link http://goo.gl/yl5D3 | |
| */ | |
| function iweb_modest_youtube_player( $html, $url, $args ) { | |
| return str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&showinfo=0&rel=0', $html ); | |
| } | |
| add_filter( 'oembed_result', 'iweb_modest_youtube_player', 10, 3 ); |
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 getEmbedCode($url="") { | |
| $return = ''; | |
| $providers = array( | |
| 'flickr.com' => 'https://www.flickr.com/services/oembed/', | |
| 'huffduffer.com' => 'https://huffduffer.com/oembed', | |
| 'instagram.com' => 'https://api.instagram.com/publicapi/oembed', |
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
| /** | |
| * Get YouTube ID from various YouTube URL | |
| * @author: takien | |
| * @url: http://takien.com | |
| * For PHP YouTube parser, go here http://takien.com/864 | |
| */ | |
| function YouTubeGetID(url){ | |
| var ID = ''; | |
| url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/); |
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
| #!/bin/bash -e | |
| clear | |
| echo "============================================" | |
| echo "WordPress Install Script" | |
| echo "============================================" | |
| echo "Database Name: " | |
| read -e dbname | |
| echo "Database User: " | |
| read -e dbuser | |
| echo "Database Password: " |
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 install curl gnupg2 ca-certificates lsb-release | |
| echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list | |
| curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
| sudo apt update | |
| NGINX_VERSION=$(apt show nginx | grep "^Version" | cut -d " " -f 2 | cut -d "-" -f 1) | |
| # take note of the nginx version in the "stable" release. e.g. 1.14.2 | |
| echo NGINX version $NGINX_VERSION | |
| wget https://hg.nginx.org/pkg-oss/raw-file/default/build_module.sh | |
| chmod a+x build_module.sh |
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
| # Optimized my.cnf configuration for MySQL/MariaSQL | |
| # | |
| # by Fotis Evangelou, developer of Engintron (engintron.com) | |
| # | |
| # ~ Updated January 2020 ~ | |
| # | |
| # | |
| # The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores. | |
| # If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
| # |
Here's a 'simple' way to get the YouTube subscriber number from Google's Youtube API v3:
- Go to https://console.developers.google.com/apis/library
- Log in with your Google account.
- Next to the logo click on 'Project' and 'Create project'. Name it whatever you want and click on 'Create'.
- Wait until the project is created, the page will switch to it by itself, it will take a couple of seconds up to a minute. Once it's done it will be selected next to the logo.
- Once it's created and selected, click on 'Credentials' from the menu on the left.
- Click on 'Create Credentials' and choose 'API Key'. You can restrict it to specific IPs, or types of requests (website, android, ios etc.) if you want, it's safer that way.