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 * as cheerio from "cheerio"; | |
import puppeteerExtra from "puppeteer-extra"; | |
import stealthPlugin from "puppeteer-extra-plugin-stealth"; | |
import chromium from "@sparticuz/chromium"; | |
async function searchGoogleMaps() { | |
try { | |
const start = Date.now(); | |
puppeteerExtra.use(stealthPlugin()); |
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
/* eslint-disable */ | |
!(function(D, u) { | |
"object" == typeof exports && "undefined" != typeof module | |
? u(exports) | |
: "function" == typeof define && define.amd | |
? define(["exports"], u) | |
: u(((D = D || self).window = D.window || {})); | |
})(this, function(e) { | |
"use strict"; | |
var v = ""; |
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
<html> | |
<p style="width: 70%;margin: auto;margin-top: 5%;font-size:larger;text-align:center"> | |
Download a file from any URL</p> | |
<form method="post" style="width: 70%;margin: auto;margin-top: 10%;"> | |
<input name="url" size="50" placeholder="Source URL" style="width: 100%;height: 10%;font-size: 1.5em;padding:10px" required> | |
<input name="submit" type="submit" value="Download" style="width: 30%;height: 10%;margin: 5% auto; display: block;"> | |
<p style="width: 70%;margin: auto;margin-top: 10%;font-size:larger;text-align:center"> | |
To <?php echo getcwd(); ?></p> | |
<p style="width: 70%;margin: auto;font-size: smaller;text-align: center;position: fixed;bottom: 0;background: #fff;"> | |
Powered by: <a href="https://karthikbhat.net/portfolio" target="_blank" style="color:#f60;text-decoration:none;">Karthik</a></p> |
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 | |
/** | |
* Get the Yoast primary category from its post meta value, and displays it, with HTML markup. | |
* If there is no primary category set, it displays the first assigned category. | |
* | |
* @param boolean $useCatLink Whether to link the category, if it exists | |
* @return void | |
*/ | |
function yourtheme_display_yoast_primary_category( $useCatLink = true ) { |
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 | |
// PHP memory limit for this site | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
// Database | |
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
// Explicitely setting url |
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 | |
/** | |
* Update Post Title from an ACF field value on post save. | |
* | |
* Triggers on save, edit or update of published posts. | |
* Works in "Quick Edit", but not bulk edit. | |
*/ | |
function sync_acf_post_title($post_id, $post, $update) { | |
$acf_title = get_field('my_acf_field_name', $post_id); // NOTE: enter the name of the ACF field here |