pip install git-filter-repo
git filter-repo --invert-paths --path "database/large-file.sql"
| # source : https://linuxize.com/post/how-to-install-php-8-on-ubuntu-20-04/ | |
| # Enableging the PHP Repo | |
| sudo apt install software-properties-common | |
| sudo add-apt-repository ppa:ondrej/php | |
| # Nginx cconfig to specify which php fpm sock to use. | |
| /etc/nginx/sites-enabled/site.local |
| # config to don't allow the browser to render the page inside an frame or iframe | |
| # and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking | |
| # if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri | |
| # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options | |
| add_header X-Frame-Options SAMEORIGIN; | |
| # when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header, | |
| # to disable content-type sniffing on some browsers. | |
| # https://www.owasp.org/index.php/List_of_useful_HTTP_headers | |
| # currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx |
| <?php | |
| if (!function_exists('getOrderDetailById')) { | |
| //to get full order details | |
| function getOrderDetailById($id, $fields = null, $filter = array()) { | |
| if (is_wp_error($id)) | |
| return false; |
| <?php | |
| /********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
| /* Add Trailing Slash to Home Canonical - Yoast SEO | |
| * Credit: Unknown | |
| * Last Tested: Unknown | |
| */ | |
| add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_home_url_slash' ); | |
| function yoast_seo_canonical_change_home_url_slash( $canonical_url ) { |
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
| <?php | |
| /** | |
| * Plugin Name: CS Repeater Download | |
| * Plugin URI: https://casperschultz.dk | |
| * Description: Plugin for downloading repeater field data. | |
| * Author: Casper Schultz | |
| * Author URI: https://casperschultz.dk | |
| * Text Domain: cs-repeater-download | |
| * Domain Path: /lang/ | |
| * Version: 1.0 |
| /** | |
| * Hide the main editor on specific pages | |
| */ | |
| define('EDITOR_HIDE_PAGE_TITLES', json_encode(array())); | |
| define('EDITOR_HIDE_PAGE_TEMPLATES', json_encode(array('template-cars.php'))); | |
| /** | |
| * Hide the main editor on defined pages | |
| * |
| <?php | |
| // Created following https://medium.com/@bkwebster/how-to-get-instagram-api-access-token-and-fix-your-broken-feed-c8ad470e3f02 | |
| function get_instagram($user_id=XXXXXXXXX, $count=18, $width=190, $height=190){ | |
| $url = 'https://api.instagram.com/v1/users/'.$user_id.'/media/recent/?access_token=XXXXXXXXXXXXXXXXXXXXXX&count='.$count; | |
| // Also Perhaps you should cache the results as the instagram API is slow | |
| $cache = './instagram/'.sha1($url).'.json'; | |
| if(file_exists($cache) && filemtime($cache) > time() - 60*60){ | |
| // If a cache file exists, and it is newer than 1 hour, use it |