Skip to content

Instantly share code, notes, and snippets.

View olawanlejoel's full-sized avatar
:dependabot:
Building...

Joel Olawanle olawanlejoel

:dependabot:
Building...
View GitHub Profile
@olawanlejoel
olawanlejoel / script.sh
Created December 16, 2025 18:19
Automate local API testing with Bash
#!/bin/bash
set -e
EMAIL="testuser_$(date +%s)@example.com"
PASSWORD="securePassword123!"
NEW_PASSWORD="newSecurePassword456!"
NAME="Test User"
echo "================================"
<?php
/**
* Plugin Name: Font Weight Options
* Description: Manage custom font weights for body text, headings, and code elements.
*/
// Prevent direct access.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@olawanlejoel
olawanlejoel / gist:76701f8ba7f8a6abbdec4791b02e7ad7
Created September 22, 2025 14:20
Pruned Kinsta API OpenAPI 3.1.0 specification for use with Custom GPT actions.
openapi: 3.1.0
info:
title: Kinsta API (Pruned for Custom GPT)
version: 1.0.2
description: Subset of Kinsta API excluding Applications, Databases, and Static Sites.
servers:
- url: https://api.kinsta.com/v2
security:
now we are more focused on the dev mode and not the AI mode. but here is the issue we experience. when we scrape on headless: true, we experience this thing where we get the parameter to be injected but i dont know if it injects but it ends up not solving. but when we set headless to false then it scrapes
Edit
Relevant chats
I see the issue! This is a common problem with Cloudflare Turnstile captchas in headless mode. Let me analyze what's happening:
The Problem
When headless: true, you're getting the Turnstile parameters intercepted correctly, but the captcha isn't actually being solved. When headless: false, it works fine. This suggests a few potential issues:
// ...existing code...
useEffect(() => {
if (typeof window === 'undefined') return; // Prevent SSR issues
if (hasRestored.current) return;
const activeJobId = localStorage.getItem("spidra-active-job");
if (activeJobId) {
try {
const parsed = JSON.parse(activeJobId);
@olawanlejoel
olawanlejoel / script.sh
Created January 14, 2025 14:25
Updating plugins across multiple sites with Kinsta API — shell scripting
update_plugin_across_sites() {
PLUGIN_NAME=$1
if [ -z "$PLUGIN_NAME" ]; then
echo "Error: Plugin name is required."
echo "Usage: $0 update-plugin <plugin_name>"
return 1
fi
echo "Fetching all sites in the company..."
/*
Theme Name: Kinsta Blog Theme
Author: Joel Olawanle
Author URI: https://kinsta.com/blog/author/joelolawanle/
Description: A thoughtfully designed WordPress theme crafted specifically for illustrating the process of theme creation. This theme provides a clean, responsive layout suitable for showcasing articles and tutorials, making it an ideal choice for blog posts and educational content related to web development and design.
Version: 1.0
License: GNU General Public License v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
@olawanlejoel
olawanlejoel / App.js
Created July 1, 2022 18:44
How to perform Pagination with GraphCMS and React from Scratch using GraphQL to query data.
import React, { useState, useEffect } from 'react';
import { request } from 'graphql-request';
import Paginate from './Paginate';
const App = () => {
const [blogPosts, setBlogPosts] = useState([]);
const [currentPage, setCurrentPage] = useState(1);
const [totalPosts, setTotalPosts] = useState();
const [postsPerPage] = useState(3);
@olawanlejoel
olawanlejoel / setup.dockerfile
Last active September 6, 2022 15:34
docker-compose
docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:0.15.3
@olawanlejoel
olawanlejoel / App.js
Created July 13, 2022 21:25
How To Perform GET HTTP Request in React’s Functional Component With Fetch API
import { useState, useEffect } from "react";
const App = () => {
const [posts, setPosts] = useState([]);
useEffect(() => {
fetch("https://jsonplaceholder.typicode.com/posts")
.then((res) => res.json())
.then((data) => {
console.log(data);