Skip to content

Instantly share code, notes, and snippets.

View oneblackcrayon's full-sized avatar

Frederick Polk oneblackcrayon

View GitHub Profile
@sandeshjangam
sandeshjangam / woocommerce-add-new-tab-my-account-page.php
Last active June 7, 2025 02:50
WooCommerce - Add New “Tab” at My Account Page
<?php
/**
* @snippet WooCommerce How To Add New Tab @ My Account
* @how-to Watch tutorial @ https://techiesandesh.com
* @author Sandesh Jangam
* @compatible WooCommerce 3.6.2
* @donate $7 https://www.paypal.me/SandeshJangam/7
*/
/**
@lukecav
lukecav / .user.ini
Created April 10, 2019 20:27
.user.ini settings example
memory_limit = 256M
upload_max_filesize = 300M
max_file_uploads = 300M
post_max_size = 300M
max_execution_time = 800
max_input_time = 800
max_input_vars = 3000
@ApoGouv
ApoGouv / 00_wp-optimizations-security-n-cleanup.md
Last active March 31, 2026 08:26
WP - Optimizations, Security hardening and Cleanup.

🗺️ WordPress Optimization, Security & Cleanup Roadmap

This guide summarizes the files and methodology used for advanced hardening, performance tuning, and cleanup of a WordPress installation.

1. 📂 Server Configuration & .htaccess (01.htaccess)

This file is the primary layer for security and performance at the server level.

  • 🛡️ Security Hardening:
@wpscholar
wpscholar / webpack.config.js
Last active March 15, 2022 01:06
Get started with WebPack in WordPress today!
'use strict';
const autoprefixer = require('autoprefixer');
const browsers = require('@wordpress/browserslist-config');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = function (env, options) {

Web Developer Road Map for 2019

Found this great "Web Development In 2019 - A Practical Guide" from Traversy Media, where he discuss about practical guide for web development in 2019. I decided to list it down and follow along to improve my web development skills.

HTML & CSS – Always the very first thing to learn

semantic HTML elements
Basic CSS (Positioning, box model)
FlexBox & CSS Grid CSS Variables (Custom Properties)

@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 24, 2026 07:05
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@mrubiosan
mrubiosan / stripe_copy.php
Created December 13, 2018 05:36
Migrate Stripe Products and Plans
<?php
$fromToken = 'rk_live_abc';
$toToken = 'rk_test_def';
$prodContext = stream_context_create([
'http' => [
'header' => "Authorization: Bearer $fromToken\r\n"
]
]);
$testContext = stream_context_create([

Your First Block

To make things simple, we're going to make a semi-structured way to display a mailing address.

We're going to start with a file tree that looks like this:

address-block
  ├ blocks
  | ├ address.jsx
@kagg-design
kagg-design / is_gutenberg_active.php
Last active May 27, 2025 17:56
Function to check if Gutenberg is active.
<?php
/**
* Check if Block Editor is active.
* Must only be used after plugins_loaded action is fired.
*
* @return bool
*/
function is_active() {
// Gutenberg plugin is installed and activated.
$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );