Skip to content

Instantly share code, notes, and snippets.

View aida-martinez's full-sized avatar
👩‍💻
Learning

Aida Martinez aida-martinez

👩‍💻
Learning
View GitHub Profile
@LearnWebCode
LearnWebCode / index.js
Created July 21, 2021 23:41
Puppeteer / Node.js Automation & Web Scraping Tutorial from YouTube
// in a new folder be sure to run "npm init -y" and "npm install puppeteer"
const puppeteer = require("puppeteer")
const fs = require("fs/promises")
async function start() {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto("https://learnwebcode.github.io/practice-requests/")
const names = await page.evaluate(() => {
@rmorse
rmorse / sf-pro-filter-input-object.php
Last active February 6, 2024 23:01
Search & Filter Pro - Filter Input Object
<?php
function filter_input_object($input_object, $sfid)
{
//ensure we are only filtering the correct field name - in this case the field we want to filter has the name `_sfm_colours`
//we also want to make sure its a `select` input type we're filtering
if(($input_object['name']!='_sfm_colours')||($input_object['type']!='select'))
{
return $input_object;
}
@hereswhatidid
hereswhatidid / custom-acf-wysiwyg-css.php
Last active September 27, 2022 15:27
Applies defined CSS classes to the ACF WYSIWYG editor so that you can individually style them.
<?php
function hwid_acf_admin_footer() {
?>
<script>
( function( $) {
acf.add_filter( 'wysiwyg_tinymce_settings', function( mceInit, id ) {
// grab the classes defined within the field admin and put them in an array
var classes = $( '#' + id ).closest( '.acf-field-wysiwyg' ).attr( 'class' );
@jwondrusch
jwondrusch / wordpress-disable-distraction-free.php
Last active September 13, 2022 18:02
Disable Distraction Free Writing Mode and Full Height Editor editor based on a list of post types.
<?php
/**
* Disable Distraction Free Writing Mode and the "Auto Expanding"
* height of the editor based on a list of post types.
*
* @return void
*/
function my_deregister_editor_expand($val, $post_type)
{