Skip to content

Instantly share code, notes, and snippets.

View s3rgiosan's full-sized avatar

Sérgio Santos s3rgiosan

View GitHub Profile
@soderlind
soderlind / README.md
Last active May 13, 2025 01:29
Enable WordPress Customizer Preview on Mapped Domain
@soderlind
soderlind / README.md
Last active February 13, 2025 11:06
Create a WordPress custom search
@petenelson
petenelson / wp-multipart-image-upload.php
Last active May 2, 2025 03:53
WordPress: Upload image to REST API via multipart/form-data body
<?php
/**
* Creates a multipart/form-data body for an image and form fields.
*
* @param string $file_path The path to the file.
* @param string $filename The base filename, if different from the file path.
* @param array $fields The form fields.
* @return array The boundary ID and the body.
*/
@soderlind
soderlind / docker-compose.yml
Last active March 14, 2025 22:53
Buggregator for local WordPress development
services:
buggregator:
image: ghcr.io/buggregator/server:latest
depends_on:
buggregator-database:
condition: service_healthy
ports:
- 127.0.0.1:8000:8000 # Sentry, Ray
- 127.0.0.1:1025:1025 # SMTP
environment:
@drewdiver
drewdiver / tokyo_night_storm.txt
Created December 20, 2022 15:18
Simple Tokyo Night theme adaptaion for Slack
Based on https://github.com/enkia/tokyo-night-vscode-theme
#24283B,#FFC806,#565F89,#C0CAF5,#565F89,#C0CAF5,#9ECE6A,#F7768E,#24283B,#A9B1D6
@Zodiac1978
Zodiac1978 / toolbox.md
Last active June 29, 2023 12:48
List of useful online tools for website QA
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Fragment } from 'react';
import { BlockControls } from '@wordpress/block-editor';
import { isUnmodifiedDefaultBlock } from '@wordpress/blocks';
import {
ToolbarButton,
ToolbarGroup,
} from '@wordpress/components';
/**
* WordPress dependencies
*/
import { createPortal, useEffect, useState } from '@wordpress/element';
import { registerPlugin } from '@wordpress/plugins';
import { Button } from '@wordpress/components';
function MyToolbarButton() {
// Lazy and one time initializations, also gives us a stable reference.
const [ container ] = useState( () => {
@felipeelia
felipeelia / ngrok.php
Last active September 1, 2022 23:41
WordPress MU Plugin to have it working with ngrok.io
<?php
/**
* Place this file in the wp-content/mu-plugins directory and run ngrok with
* `ngrok http http://<local_url> --host-header=<local_url>`
*/
$ngrok_url = '<id>.ngrok.io';
define( 'WP_HOME', 'http://' . $ngrok_url );
define( 'WP_SITEURL', 'http://' . $ngrok_url );
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');