Skip to content

Instantly share code, notes, and snippets.

View mae829's full-sized avatar

Miguel A. Estrada mae829

View GitHub Profile
# Brew
/bin/bash -c "$(curl -fsSL"
curl -o- | bash
# oh my ZSH
sh -c "$(curl -fsSL"
pixelbrackets /
Last active February 2, 2024 08:08
Manage GitHub & GitLab Credentials in Composer
felipeelia / ngrok.php
Last active September 1, 2022 23:41
WordPress MU Plugin to have it working with
* 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>';
define( 'WP_HOME', 'http://' . $ngrok_url );
define( 'WP_SITEURL', 'http://' . $ngrok_url );
kingkool68 / use-remote-media.php
Last active March 24, 2024 11:37
Check if a local file exists in the WordPress media library and if it doesn't exist, replace the URL with a different URL. Helpful when working with a local site that doesn't have all of the media downloaded as the production site. See
// Put this in wp-config.php and replace with the URL of the production site.
define( 'RH_USE_REMOTE_MEDIA_URL', '' );
// Put the rest of this in functions.php or a custom plugin or somewhere else.
if ( defined( 'RH_USE_REMOTE_MEDIA_URL' ) && ! empty( RH_USE_REMOTE_MEDIA_URL ) ) {
add_filter( 'wp_get_attachment_image_src', 'filter_wp_get_attachment_image_src' );
add_filter( 'wp_calculate_image_srcset', 'filter_wp_calculate_image_srcset' );
add_filter( 'wp_get_attachment_url', 'filter_wp_get_attachment_url' );
abelcheung /
Last active May 28, 2023 18:18
Customizing Firefox view-source style -- Solarized Dark theme with wallpaper

Customizing Firefox view-source style


  1. Open (or create) chrome/userContent.css under your Firefox profile folder
  2. Append attached CSS content and save file
  3. Toggle toolkit.legacyUserProfileCustomizations.stylesheets in Firefox about:config
  4. Restart Firefox

firefox view-source style customization

jonjack /
Last active July 23, 2024 09:33
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-

jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
jesperorb /
Last active April 30, 2024 22:27
PHP form submitting with fetch + async/await

PHP Form submitting

If we have the following structure in our application:

  • 📁 application_folder_name
    • 📄 index.php
    • 📄 handle_form.php
    • 📄 main.js

And we fill our index.php with the following content just to get a basic website with a form working. You should be able to run this through a php-server of your choice.

andrewlimaza / jquery-datepicker-wp-admin
Created July 24, 2017 10:59 — forked from slushman/jquery-datepicker-wp-admin
How to Add the jQuery UI Datepicker to the WordPress Admin
* Adds the datepicker settings to the admin footer.
* Only loads on the plugin-name settings page
function admin_footer() {
$screen = get_current_screen();
if ( $screen->id == 'settings_page_plugin-name' ) {

Custom Gutenberg Block

This is a basic custom Gutenberg block. Files explained below.

  • block.js — We register Custom Gutenberg block here.
  • editor.css _ Block CSS for the editor.
  • style.css — Block CSS for the front end.
  • index.php — Enqueue block's assets for editor and the front end.