Skip to content

Instantly share code, notes, and snippets.

View thomasprost's full-sized avatar
🏠
Working from home

Thomas Prost thomasprost

🏠
Working from home
View GitHub Profile
@AbmSourav
AbmSourav / script.js
Last active October 17, 2024 20:34
WordPress ajax call with Fetch API
// php file
function enqueue_scripts() {
wp_enqueue_script( 'public-js', plugin_dir_url( __FILE__ ) . 'js/script.js', array(), '1.0', true );
wp_localize_script( 'public-js', 'localizeObj',
[
'ajax_url' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'prefix_public_nonce' ),
]
);
}
@EmilyRosina
EmilyRosina / jsconfig.json
Created November 13, 2020 20:46
VSCode config to get CTRL + click and Class intellisense working everywhere
{
// This file is required for VSCode to understand webpack aliases
"module": "es6",
"moduleResolution": "node",
"compilerOptions": {
"resolveJsonModule": true,
"jsx": "preserve",
"module": "commonjs",
"target": "es5",
"sourceMap": true,
@Ruzgfpegk
Ruzgfpegk / wp-perf.md
Last active June 28, 2025 03:36
WordPress Performance & Development tips