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
-- ======================================== | |
-- 🔄 WordPress Scam Cleanup Script | |
-- 🧑 Clean all content, meta, tags, attachments, and user data for a specific user | |
-- 💡 Replace the value of @user_id to clean up another account | |
-- ======================================== | |
-- Step 0: Set the user ID to clean up | |
SET @user_id := 110133; | |
-- Step 1: Create a temporary table for all pending posts by this user |
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
This is how I solved this problem, on MySQL 9 and it doesn't use a password for the root user. | |
brew services stop mysql | |
mysqld_safe --skip-grant-tables & | |
mysql -u root | |
USE mysql; | |
UPDATE user SET plugin = 'caching_sha2_password' WHERE User = 'root'; | |
EXIT; | |
killall mysqld | |
brew services start mysql |
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
write a php api class for this | |
curl https://api.openai.com/v1/chat/completions \ | |
-H "Authorization: Bearer $OPENAI_API_KEY" \ | |
-H "Content-Type: application/json" \ | |
-d '{ | |
"model": "gpt-3.5-turbo", | |
"messages": [{"role": "user", "content": "What is the OpenAI mission?"}] | |
}' |
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
Write a sql query to retrieve information about customers, their orders, and the products they ordered. It should return results for customers in New York who placed orders in the year 2022 for products with a quantity of at least 5. The results should be sorted first by order date in descending order, then by product name in ascending order. |
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
Give me the main gist of this | |
Hooks | |
TOPICS | |
Actions vs. Filters | |
More Resources | |
Hooks are a way for one piece of code to interact/modify another piece of code at specific, pre-defined spots. They make up the foundation for how plugins and themes interact with WordPress Core, but they’re also used extensively by Core itself. | |
There are two types of hooks: Actions and Filters. To use either, you need to write a custom function known as a Callback, and then register it with a WordPress hook for a specific action or filter. |
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
1. Transform code from one language to another | |
Prompt: | |
Write this code in Java | |
<?php | |
class Animal | |
{ | |
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 | |
use Illuminate\Support\Str; | |
return [ | |
/* | |
|-------------------------------------------------------------------------- | |
| Default Database Connection Name | |
|-------------------------------------------------------------------------- |
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
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
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 | |
namespace App\Acme; | |
use Carbon\Carbon; | |
// now, this class only gets the sales between the given dates. | |
// It doesn't deal with how with sales are stored, it doesn't | |
// deal with how to format the output, it doesn't deal with Auth | |
class SalesReporter |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder