• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Tools

VS Code: Open MD files in Preview Mode

August 14, 2026 by Webhead

Problem:

When viewing Markdown files in Visual Studio Code it opens in the edit mode and you see markdown instead of the formatted version. To see the formatted version you have to right click on the tab and Open Preview mode. It’s often quicker to just read the file.

Solution:

Can’t believe I’ve gone so long without this. Open the Command Pallet (Crl+Shift+P / Cmd+Shift+P) and select Preferences: Open User Settings (JSON)

Add the following entry:

"workbench.editorAssociations": {
  "*.md": "vscode.markdown.editor"
},
"markdown.preview.doubleClickToSwitchToEditor": true

When you need to edit the Markdown source, you can flip the toggle between the lock icon and the pencil icon.

Side note, if you’re in “Markdown Preview” (not Markdown Editor), you can switch from Preview to editing using these methods:

  • Double-clicking anywhere on the rendered preview page
  • Ctrl+Shift+V / Cmd+Shift+V
  • At the top right, there’s a toolbar you can use to switch between editor and preview mode.

Filed Under: Off the Shelf, Tools Tagged With: markdown, vs code

Thisisunsafe

May 23, 2022 by Webhead

Problem

Sometimes you need to run https sites locally and you can’t get by Chrome’s warning of NET::ERR_CERT_INVALID. Google has removed the link to just bypass this warning recently.

Solution

While this is more of a workaround than a solution (you should resolve the invalid cert), you can get by Chrome’s security warning by typing “thisisunsafe”. Don’t type it in the address bar, just have the window in focus. You won’t see what you’re typing, but when you finish typing the browser window will reload and display the site.

Filed Under: Tools Tagged With: chrome

PHPUnit and PHP 7 problems

April 23, 2018 by Webhead

Problem

I’m using PHPUnit 5.5, upgraded my PHP version to 7.2.  Two problems actually occur.  First there’s this weird error:

Fatal error: Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals…

Then figuring PHPUnit needs to be upgraded, I ran

phpunit –self-upgrade

And that failed with the same error.  Changing my PHP version back down to 5.6 and running then causes this error:

internal corruption of phar “…phpunit-temp.phar” (truncated entry)

 

Solution

Unfortunately PHPUnit 5.5 only supports up to version 7.1 and any old version of PHPUnit that has an “old” certificate needs to be downloaded/updated manually.

https://github.com/sebastianbergmann/phpunit/issues/1688

 

Filed Under: Coding, Tools

Easy WordPress Localization

November 13, 2013 by Webhead

If you want to localize a plugin or theme or even just change some wording around, or if you are starting from scratch the easiest thing to do is install the Codestyle Localization plugin.

If starting from scratch, just  make sure your plugin or theme loads the file using

[prettify class=”php”] <?php load_plugin_textdomain( $domain, $abs_rel_path, $plugin_rel_path ) ?> [/prettify]

Once that line of code is in the plugin or theme go to Tools->Localization and you should see your plugin or theme listed.

Find your plugin or theme and click on the Add New Language buttton.

Click Rescan.  Have it scan the files.

Click Edit

Click on generate mo-file.

Then you’re all done.

Filed Under: Coding, Off the Shelf, Tools Tagged With: localization, php, wordpress

Environment Setup

October 25, 2013 by Webhead

October 10, 2022

After 9 years, I thought I’d update this list of tools. Only a few passed the test of time:

  • Forklift – (paid) I forgot why I stopped using FileZilla. I think it was just becoming an eyesore.
  • Local WP – Easy setup, easy install, easy to manage WordPress sites.
  • SourceTree – to push/pull your code so it stays in synch with other environments you may have or other teammates.
  • Visual Studio Code – THE editor being used today. Extensions, open source, supported by a big company (Microsoft).  
  • Slack – Still the top chat program.  Crazy, I don’t remember the name “HipChat”. I just remember there was a chat program between AIM and Slack that I used.
  • ImageOptim – To optimize images, taking up less disk space and load faster.
  • Webpack – This is a bundler that has a very steep learning curve. But once set up, it’s not bad.

Virtual Box is still used occasionally, but tools like BrowserStack is enough and IE not being used (finally) helps too.

Dropbox is still worthy to use, but Google Drive is much easier to use. Although it’s not in the list because I don’t use it much.

October 25, 2013

This week I had to temporarily work on a new laptop so I had to set up my dev environment from scratch.  Of course, I wanted the same tools and apps I had on my permanent environment.  I find that these tools and apps stick with you for some time so below is a list of apps that I needed to install on my new development environment.

  • Dropbox – to easily share files between computers both locally and over the web.
  • FileZilla – to upload files to the servers
  • MAMP – to test your code locally before uploading to the live servers
    • See MAMP Optimizations to start MAMP on startup without the GUI.
    • Remember to set the <Directory> override to AllowOverride All if you want your WordPress or other sites to use .htaccess.
  • SourceTree – to push/pull your code so it stays in synch with other environments you may have or other teammates.
    • Set up your SSH keys using BitBucket’s tutorial.
  • Sublime Text 2  – to edit your files.
    • If you want to open files via the terminal, follow this updated tutorial.
  • WordPress – not so much a tool, but it is part of the testing environment.
  • Slack or HipChat -or whatever trending chat program.  to communicate to others
  • Virtual Box – To run those pesky versions of Internet Explorer.
    • Then head on to get free VMs from Microsoft so you can get all the lovely versions of IE.
  • ImageOptim – To optimize images, taking up less disk space and load faster.

Filed Under: Coding, Off the Shelf, Random Thoughts, Tools

GIT PUSH IS FAILED DUE TO RPC FAILURE (RESULT=56)

August 16, 2013 by Webhead

Problem

Pushing to git showed this error:

error: RPC failed; result=56, HTTP code = 0

Solution

The problem is the git buffer is too low.  After finding the solution I realized I did have a large image that I added to the repository.   To fix, run the following command.

git config http.postBuffer 524288000

Thanks to:  http://flyingtomoon.com/2011/04/12/git-push-is-failed-due-to-rpc-failure-result56/

Filed Under: Tools Tagged With: git

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to Next Page »

Primary Sidebar

Topics

apache apple chrome cms css debug eCommerce embed filters firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization macOS mac os x markdown ms sql mysql open source optimize php seo svg tinymce vs code woocommerce wordpress wpengine xss yii youtube

Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools
  • Uncategorized