Skip to content

Instantly share code, notes, and snippets.

View emiliesappracone's full-sized avatar
🎯
Focusing

emiliesappracone

🎯
Focusing
View GitHub Profile
@dbjpanda
dbjpanda / google-api.php
Last active October 22, 2024 09:33
Google API Ouath2 authentication using PHP and Curl
<?php
$end_point = 'https://accounts.google.com/o/oauth2/v2/auth';
$client_id = 'YOUR_ID';
$client_secret = 'YOUR_SECRET';
$redirect_uri = 'http://'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]'; // http://'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] or urn:ietf:wg:oauth:2.0:oob
$scope = 'https://www.googleapis.com/auth/drive.metadata.readonly';
$authUrl = $end_point.'?'.http_build_query([
@danielbachhuber
danielbachhuber / collection-filter.js
Last active January 29, 2025 04:58
Add a custom taxonomy dropdown filter to the WordPress Media Library
(function(){
/**
* Create a new MediaLibraryTaxonomyFilter we later will instantiate
*/
var MediaLibraryTaxonomyFilter = wp.media.view.AttachmentFilters.extend({
id: 'media-attachment-taxonomy-filter',
createFilters: function() {
var filters = {};
// Formats the 'terms' we've included via wp_localize_script()
@joyrexus
joyrexus / README.md
Last active February 23, 2026 21:20 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})