This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Rewrite Media URLs | |
* Plugin URI: https://thegallagher.net/wordpress/plugins/rewrite-media/ | |
* Description: Rewrite URLs for media to a remote server for local development. | |
* Version: 1.0.1 | |
* Author: David Gallagher | |
* Author URI: https://thegallagher.net/ | |
* License: GPL v2 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# Config | |
NAME=`basename "$PWD"` | |
SERVER_URL="http://localhost/$NAME" | |
ADMIN_USER="devbox" | |
ADMIN_PASS="devbox" | |
ADMIN_EMAIL="[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Git | |
sudo apt-get -y install git | |
# Node.js | |
sudo apt-get -y install nodejs | |
sudo apt-get -y install npm | |
sudo ln -s /usr/bin/nodejs /usr/bin/node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is intended for use in development only. It is not optimized or secure for production use. | |
# Config | |
export PASSWORD=devbox | |
# Apache | |
sudo apt-get -y install apache2 | |
sudo chmod a+rwx /var/www/html # we might want to replace this with group permissions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MIT License | |
* | |
* Copyright (c) 2016 David Gallagher | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery(function($) { | |
var iframe = $('<iframe></iframe>'); | |
iframe.attr('name', 'tellink'); | |
iframe.css('display', 'none'); | |
iframe.appendTo('body'); | |
$('a[href^="tel:"]').attr('target', 'tellink'); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trigonometry functions from https://unindented.org/articles/trigonometry-in-sass/ | |
@mixin stroke($width, $color, $step-multiplier: 8) { | |
$unit: unit($width); | |
$unitless: $width / ($width * 0 + 1); | |
$steps: $unitless * $step-multiplier; | |
$shadow: ''; // need a starter | |
@for $i from 0 to $steps { | |
$x: $width * cos(2 * pi() * $i / $steps); | |
$y: $width * sin(2 * pi() * $i / $steps); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get a shipping estimate for a product | |
* | |
* @param \WC_Product|int|null $product | |
* | |
* @return array|null | |
*/ | |
function get_product_shipping_estimate($product = null) { | |
if ($product === null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Filezilla site manager duplicates remover. | |
* Please backup your sitemanager.xml file before using. | |
*/ | |
// OPTIONS: change here as required. | |
define('OUTPUT_XML', true); // If set to true then output the browser, otherwise false to save directly back to the file. |