Skip to content

Instantly share code, notes, and snippets.

INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@saprativa
saprativa / summarization.ipynb
Last active February 5, 2024 07:25
Summarization of Long Documents using Transformers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kkirsche
kkirsche / Install Composer to use MAMP's PHP.md
Last active January 30, 2024 02:30
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@johnbillion
johnbillion / wp_mail.md
Last active January 27, 2024 14:06
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@jdevalk
jdevalk / .htaccess
Last active November 28, 2023 20:28
These three files together form an affiliate link redirect script.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>
@ecos
ecos / FTP Upload and URL in Clipboard
Created March 19, 2013 15:13
A cool Windows batch script to upload a file to an FTP folder, and then copy the URL in the clipboard. Useful for posting screenshots quickly in a post on a forum. You only have to change these parameters SET Server=yourFTPserver SET UserName=yourFTPusername SET Password=yourpassword SET RemoteFolder=/www/images/screenshots SET ClipboardURLPrefi…
@ECHO OFF
ECHO Upload to FTP
ECHO Written by: Jason Faulkner
ECHO SysadminGeek.com
ECHO. Improved by ecos
ECHO.
REM Usage:
REM UploadToFTP [/L] FileToUpload
REM
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2019.03.03
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */

How to get Composer running on SiteGround shared

  1. Download getcomposer.org/composer.phar to your account's home directory — /home/username.
  2. Edit .bashrc file in same directory by adding alias composer='/usr/local/php56/bin/php-cli ~/composer.phar' line. Update php56 part to current relevant version, if necessary.
  3. Restart SSH session or run source ~/.bashrc to reload config.
  4. Use composer command!
@Rarst
Rarst / composer.json
Last active January 27, 2023 12:40
Test project for WordPress stack via Composer
{
"name" : "rarst/install-test",
"description" : "Test project for WordPress stack via Composer",
"authors" : [
{
"name" : "Andrey Savchenko",
"homepage": "http://www.Rarst.net/"
}
],
"type" : "project",
@jgalea
jgalea / microtime.php
Last active December 7, 2022 01:30
Test execution time of WordPress PHP function
<?php
function my_function() {
$start = microtime(true);
// function code here
$time_taken = microtime(true) - $start;
wp_die( $time_taken ); // in seconds
}