This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
<?php | |
/* | |
Plugin Name: R Debug | |
Description: Set of dump helpers for debug. | |
Author: Andrey "Rarst" Savchenko | |
Author URI: https://www.rarst.net/ | |
License: MIT | |
*/ |
<!-- This is just the code for the button and hidden input --> | |
<input id="backdrop_upload_button" value="Upload/Select Image" type="button" class="button" /> | |
<input type="hidden" name="the_image" id="the_image" value="<?= $settings['the_image'] ?>" /> |
<?php | |
/* | |
We found a lot of problems when trying to crop images through the Wordpress' add_image_size function. | |
Finally, we found out that the stupidest solution was the good for us: we just deleted a dash | |
from the string at the first parameter. We had 'foto-portada' witch didn't work, and now, 'fotoportada', wokring well. | |
It's kinda weird. |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
<?php | |
/** | |
* Get a value from an associative array or object, or return default. | |
* | |
* @param string $key Dot-separated path to key you wish to extract. | |
* @param array|object $hash Associative array or object. | |
* @param mixed $default Value to return if key is non-existent. | |
* @param bool $is_int Only return key if value is integer. | |
* @return mixed |
#!/bin/bash | |
# Regolith aka Un-Bedrock | |
# "But what if we need to hand it off to another agency?" No more! | |
# This script converts a Bedrock site to a normal WordPress structure. | |
# Run it from the root of a Bedrock project. | |
# Created by Nathan Knowler and Daniel Roe | |
echo "Converting Bedrock to a normal WordPress file structure..." |
When running WordPress or ClassicPress using a DigitalOcean managed MySQL database you may experience errors like the following:
Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'dbname.wp_posts.post_date' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by for query SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/themename/404.php'), the_widget, WP_Widget_Archives->widget, wp_get_archives
>Expression #1 of ORDER BY clause is not in SELECT list, references column 'dbname.wp_posts.post_date' which is not in SELECT list; this is incompatible with DISTINCT fo