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 change in git which I definitely don't want to commit.

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));

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 mb_convert_encoding function, not the utf8_encode function, was needed. From … Continued

Advanced Custom Fields — Update a Group Sub Field From Within a Flexible Content Field

 

 

Updating MAMP (ramblings whilst trying to update mamp)

Updating MAMP (ramblings whilst trying to update mamp)

I am a MAMP user. I’ve used it since March of 2014. I have lot’s of projects in my MAMP’s htdoc directory. I could probably clean them out/archive them, more often then I do but I don’t (I have it all on Github so there’s really no reason why). In any case, I quickly learned … Continued

Moving a site from Drupal to WordPress

Moving a site from Drupal to WordPress

Exporting from Drupal Use Views Data Export module and these instructions. When exporting tags there’s a couple options. 1. You can have all the added tags in one field value. 2. You can export each taxonomy individually. Depending on how you want the tags within the WP site you may prefer one way or another. … Continued

WordPress Admin Taxonomy Sidebar Resize

Taxonomy sidebar

I’m currently setting up an admin for a clients redesign. There’s going to be a hefty amount of categories and I wanted to make the selector in the sidebar resizable for at least a little bit easier viewing. The simple if not completely cross browser friendly (chrome, ff, safari) way to do this is css’s … Continued

Add Special Chars to WordPress TinyMCE Char Map

Had an issue where a clients blog post had one of these in the post and it wasn’t being displayed right. The real issue was changing the ‘post_content’ field of the wp_posts table to UTF-8 Unicode (utf8mb4) from cp1252 West European, but (!) along the way I tried this. Put this in a plugin or functions.php and … Continued

Bash Current Directory Path

Gives you the full directory name of the script no matter where it is being called from. https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within

Github Gist

 

Add browser and device name to WordPress body class

Github Gist

 

Recursively List Video Files URL’s

This will recursively list video files (currently filtered by a ‘.mp4’ preg_match) links when put at the root of a url. Rough and not pretty but it’s functional. Github Gist  

Reading Today

Neural Networks in JavaScript with deeplearn.js

“A couple of my recent articles gave an introduction into a subfield of artificial intelligence by implementing foundational machine learning algorithms in JavaScript (e.g. linear regression with gradient descent, linear regression with normal equation or logistic regression with gradient descent).”

read full text »