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 | |
/** | |
* The blocks class file. | |
* | |
* @package WordPress | |
* @subpackage Swift_News_Theme | |
*/ | |
namespace Swift; |
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
// https://stackoverflow.com/questions/12331633/how-to-gzip-all-files-in-all-sub-directories-into-one-compressed-file-in-bash | |
tar -zcvf compressed.tar.gz folder-to-compress |
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
git init | |
echo * > .gitignore | |
git remote add origin https://github.com/iBecCreative/REPONAMEHERE.git | |
git fetch | |
git checkout origin/production -b production |
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
<video controlslist="nodownload" autoplay muted width="100%" controls="" id="sbtvidplayer"></video> | |
<script type="text/javascript"> | |
function shuffleArray(array) { | |
var currentIndex = array.length, | |
temporaryValue, randomIndex; | |
// While there remain elements to shuffle... | |
while (0 !== currentIndex) { | |
// Pick a remaining element... | |
randomIndex = Math.floor(Math.random() * currentIndex); | |
currentIndex -= 1; |
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
// used to recursively change files to 664 and directories to 775 from parent level | |
// dir | |
find . -type d -exec chmod 775 {} \; | |
// files | |
find . -type f -exec chmod 664 {} \; |
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
// change domain of single site | |
date ; wp search-replace --url=oldsite.com oldsite.com newsite.com --debug ; date |
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
// Looking for the string of wp:acf/map within WP post content | |
SELECT * FROM wp_8_posts WHERE post_content LIKE '%wp:acf/map%' |
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 | |
// Loop through URL array and look for 404 results. | |
$url_array = ['https://facebook.com/','https://googlemaps.com/','https://gigglemips54252.com/', 'https://www.airbnb.com/']; | |
foreach ($url_array as $url_entry) { | |
$file_headers = @get_headers($url_entry); | |
$exists = !$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found' ? false : true; | |
echo $exists; | |
} |
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 | |
/** | |
* Get covid data and return as array. | |
*/ | |
public function get_covid_data() { | |
$content = []; | |
$pub_array = $this->pub_counties[$this->pub_name]; | |
if ( false === ( $covid_content = get_transient( 'swift_module_covid_' . $this->pub_name ) ) || empty( get_option( '_transient_timeout_swift_module_covid_' . $this->pub_name ) ) ) { |
NewerOlder