Skip to content

Instantly share code, notes, and snippets.

@g000m
g000m / custom-ajax-spotify.php
Created June 7, 2020 08:47 — forked from ivanlebanov/custom-ajax-spotify.php
Spotify API integration with WordPress
<?php
function ajax_enquiry_init(){
wp_register_script('jquery', 'https://code.jquery.com/jquery-1.11.2.min.js' );
wp_enqueue_script('jquery');
wp_register_script('main', get_template_directory_uri() . '/js/main.js', array('jquery') );
wp_enqueue_script('main');
wp_localize_script( 'main', 'ajax_auth_object', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
@g000m
g000m / SQLite-PHP-quickstart.php
Created February 16, 2025 00:35 — forked from bladeSk/SQLite-PHP-quickstart.php
SQLite3 PHP Quickstart Tutorial
<?php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
// Errors are emitted as warnings by default, enable proper error handling.