Save only specific files to stash in git repository

The -m will set the message for the stash and multiple files can be specified.

git stash push -m 'put back on practice-signup-changes' apps/frontend/lib/helper/SignupHelper.php apps/frontend/modules/signup/templates/practiceSuccess.php

Workaday Reading

acf_register_block_type()



"Registers a custom block type in the Gutenberg editor. Blocks are the fundamental element of the Gutenberg editor. WordPress provides many default block types such as paragraph, heading and image. The acf_register_block_type() function can be used to add new block types via PHP."

read »

Workaday Reading

ACF 5.8 – Introducing ACF Blocks for Gutenberg



"There has been a lot of excitement surrounding Gutenberg, the new block-based WordPress editing experience. One of its most compelling features is the ability for developers to create their own custom block types. This opens up an endless array of possibilities for customization."

read »

Workaday Reading

Protect our Git Repos, Stop Foxtrots Now!



"Reading Time: 6 minutes Dancers gearing up to do the Foxtrot First, what is a foxtrot merge? A foxtrot merge is a specific sequence of git commits. A particularly nefarious sequence. Out in the open, in lush open grasslands, the sequence looks like this: But foxtrots are rarely seen in the open."

read »

Workaday Reading

8 Useful JavaScript Tricks



"Each programming language has its own tricks up in its sleeve. Many of them are known to developers, and yet some of them are pretty hackish. In this article, I will show you a couple of tricks I find useful. Some of them I've used in practice and others are the new way of solving old problems."

read »

Run Shortcode in WordPress Excerpts

Add this to your functions.php or your plugin.

add_filter( 'get_the_excerpt', 'shortcode_unautop');
add_filter( 'get_the_excerpt', 'do_shortcode');
add_filter( 'get_the_excerpt', 'do_shortcode', 5 );

Git –assume-unchanged

When installing apps locally some files have data which is unique to your install path or domain. For example I installed our app at EasyRx locally and the yaml setting for the domain used for cookies was tracked by git. I changed the value in my local install but then it showed up as a … Continued

How to convert your latin1 mysql table to utf8

Convert the existing columns content if there are unicode characters saved in non utf8 column: UPDATE `databasename`.`prescription_template_billing_item` SET description = @txt WHERE char_length(description) = LENGTH(@txt := CONVERT(BINARY CONVERT(description USING latin1) USING utf8)); Have MYSQL loop through . all of your tables and columns finding all the necessary columns which have types needing to be converted: … Continued

JSON encoding Windows-1252 Unicode chars

While trying to use the json_encode function a Windows-1252 left and right quote character was breaking the encoding and I was ending up with no JSON. The string being encoded was from html within a PHP file. I’m guessing it was copy pasted from a Word doc. To fix this the <a href="http://php.net/manual/en/function.mb-convert-encoding.php">mb_convert_encoding</a> function, not the <a href="http://php.net/manual/en/function.utf8-encode.php">utf8_encode</a> function, was … Continued

Workaday Reading

vimeo autoplay=1 no longer working in Chrome



"I recently developed a website that has a streaming video as its full-screen background that autoplays & loops when the website loads. It was working in Chrome until very recently. Google changed their policy on autoplaying video in April, so I believe this may be the reason."

read »

Workaday Reading

Build your own Command Line with ANSI escape codes



"Everyone is used to programs printing out output in a terminal that scrolls as new text appears, but that's not all your can do: your program can color your text, move the cursor up, down, left or right, or clear portions of the screen if you are going to re-print them later."

read »

Workaday Reading

Content negotiation



"In HTTP, content negotiation is the mechanism that is used for serving different representations of a resource at the same URI, so that the user agent can specify which is best suited for the user (for example, which language of a document, which image format, or which content encoding)."

read »

Workaday Reading

JavaScript error reference



"Below, you'll find a list of errors which are thrown by JavaScript. These errors can be a helpful debugging aid, but the reported problem isn't always immediately clear. The pages below will provide additional details about these errors."

read »