Skip to content

Instantly share code, notes, and snippets.

@joemaller
joemaller / wordpress-wp_rewrite-rule-dump.php
Last active February 12, 2024 12:46
A default dump of WordPress `$wp_rewrite->rules` from a fresh install of WordPress v5.2.3
<?php
array (
'^wp-json/?$' => 'index.php?rest_route=/',
'^wp-json/(.*)?' => 'index.php?rest_route=/$matches[1]',
'^index.php/wp-json/?$' => 'index.php?rest_route=/',
'^index.php/wp-json/(.*)?' => 'index.php?rest_route=/$matches[1]',
'robots\\.txt$' => 'index.php?robots=1',
'.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\\.php$' => 'index.php?feed=old',
'.*wp-app\\.php(/.*)?$' => 'index.php?error=403',
'.*wp-register.php$' => 'index.php?register=true',
@hollodotme
hollodotme / Install-php7.md
Last active August 11, 2022 06:23
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@joemaller
joemaller / Managed WordPress Hosting .gitignore
Last active August 11, 2023 21:40
A comprehensive .gitignore file for managed WordPress hosts.
# Managed WordPress Hosting .gitignore file for ignoring WordPress files
#
# Most recent revision here:
# https://gist.github.com/joemaller/4f7518e0d04a82a3ca16
#
# Raw Source (for curl):
# https://gist.githubusercontent.com/joemaller/4f7518e0d04a82a3ca16/raw
#
# Used by these WordPress Development environments:
# https://github.com/ideasonpurpose/docker-wordpress-dev
@joemaller
joemaller / Readme.md
Last active February 10, 2019 23:21
A simple gulpfile example

Build-tools and Live Reload

As creating for the web has gotten more complex, build tools have become an essential part of my workflow. These tools are usually used to automate repetitive tasks such as pre-processing CSS stylesheets from Sass or Less, or compiling JavaScript from many smaller files. They can also reload browsers when files change -- not having to constantly mash reload is a significant productivity boost. Working without auto-refresh now feels like trying to type in mittens.

[Gulp][] and [Grunt][] run from the Terminal, [CodeKit][] and [LiveReload][] are standalone Mac apps. Gulp is relatively new, is very fast and its task definition files are written in JavaScript. Grunt is more established, works well and has a ton of people using it, but can be slower and requires a lot more configuration using verbose JSON files. CodeKit and LiveReload help with common workflows, Gulp and Grunt can do just about anything imaginable.

I’d been happily using Grunt for a while, but increasing buzz a

@RnbWd
RnbWd / build.js
Last active September 7, 2016 16:28
watchify-gulpify
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var config = require('../config.json');
var bundler = require('./bundler');
process.env.APP_ID = config.Client.AppId;
process.env.JS_KEY = config.Client.jsKey;
gulp.task('scripts', function() {
gulp.src('./src/js/init.js', {read: false})
@paulund
paulund / example-wp-list-table.php
Last active March 31, 2024 05:40
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py
index 1755879..d305a38 100644
--- a/lib/ansible/runner/__init__.py
+++ b/lib/ansible/runner/__init__.py
@@ -411,6 +411,7 @@ class Runner(object):
inject = utils.combine_vars(inject, self.module_vars)
inject = utils.combine_vars(inject, self.setup_cache[host])
inject.setdefault('ansible_ssh_user', self.remote_user)
+ inject.setdefault('ansible_connection', host_connection)
inject['hostvars'] = HostVars(self.setup_cache, self.inventory)
#!/bin/bash
# Add Vagrant's NFS setup commands to sudoers, for `vagrant up` without a password
# Updated to work with Vagrant 1.3.x
# Stage updated sudoers in a temporary file for syntax checking
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
@msurguy
msurguy / eloquent.md
Last active February 8, 2022 03:13
Laravel 4 Eloquent Cheat Sheet.

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: