Skip to content

Instantly share code, notes, and snippets.

View bonny's full-sized avatar
🇺🇦
StandWithUkraine

Pär Thernström bonny

🇺🇦
StandWithUkraine
View GitHub Profile
@jaredatch
jaredatch / mailhog-mamp.md
Created January 30, 2018 21:57
Install MailHog with MAMP Pro

Install MailHog with MAMP Pro, using HomeBrew.

MailHog

First let's make sure HB is updated. Open up terminal for the following steps.

$ brew update
@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

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)
@markjaquith
markjaquith / nginx.erb
Created April 19, 2014 17:21
Nginx setup
server {
listen 80;
<% if @use_ssl %>
listen 443 ssl spdy;
ssl_certificate ssl/<%= @domain %>/server.crt;
ssl_certificate_key ssl/<%= @domain %>/server.key;
<% end %>
server_name <%= @domain %><% if @also_www %> www.<%= @domain %><% end %>;
access_log /var/log/nginx/access.log main;
<?php
/**
* Plugin Name: Static Templates
*
* If most of your site content is in .php template files, and you're tired of
* creating new pages, assigning them page templates, creating page templates
* then doing it all over again on production, this plugin is for you.
*
* Examples:
*
@mpouncy-netpulse
mpouncy-netpulse / jquery.alterclass.js
Last active January 11, 2018 19:00 — forked from peteboere/jquery.alterclass.js
jQuery alterClass plugin: Remove element classes with wildcard matching. Optionally add classes.
/**
* jQuery alterClass plugin
*
* Remove element classes with wildcard matching. Optionally add classes:
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' )
*
* Copyright (c) 2011 Pete Boere (the-echoplex.net)
* Updated 2013 by Mike Pouncy (scrupl.es) - Condensed code, removed unneeded vars.
* Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php
*
@markjaquith
markjaquith / gist:6225805
Last active February 21, 2024 23:56
WordPress multi-tenant directory structure sharing core files for opcode awesomeness, fast deployments, and low disk usage. With inspiration from @weskoop. "=>" indicates a symlink.
sites
|__ ms.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
| |__ wp-config.php
|__ one.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
@pento
pento / commercial-client.php
Created July 2, 2013 12:29
Sample Commercial Plugin update server and client
<?php
/*
* Plugin Name: Commercial Client
* Plugin URI: http://pento.net/
* Description: A sample client plugin for showing updates for non-WordPress.org plugins
* Author: pento
* Version: 0.1
* Author URI: http://pento.net/
* License: GPL2+
*/
@bonny
bonny / with-posts-wordpress-function.php
Last active May 9, 2016 18:50
WordPress function with_posts(), that simplifies getting and looping posts, in a jQuery anonymous function-ish way. Setups global, restores post afterwards. Simple, flexible and powerful.
<?php
/**
* WordPress WP_QUERY-wrapper to simplify getting and working with posts
*
* Does something with posts, using a callback
* Setups global post variable before running callback
* And restores it afterwards
*
* An introductionary blogpost about this function is posted on our blog:
@fearphage
fearphage / README.md
Last active October 18, 2022 20:19
$.whenAll jQuery extension

$.whenAll is an extension to jQuery's $.when. The main difference is $.when stops when it receives the first rejected promise. This extension treats all successes and failures as progress events. After all the promises have completed, the global promise is resolved if there were no errors. Otherwise the global promise is rejected.

Sameple #1

$.whenAll($.get('http://github.com'), $.get('good luck with this one'))
  .then(
    // success callback
    function(request) {}
    // failure callback - called once at the end
 ,function() {}