Category: Code snippets

  • jQuery to remove a link and just replace it with anchor text

    Occasionally a WordPress plugin is not templated, so difficult to customise the output, so in these circumstances one solution is to use jQuery to modify the output. Now this is not pure and a bit hacky, as ideally you would change the code that is producing the output.  However the situation is just sometimes that isn’t…

  • Sailwave and sending files by SCP or SFTP

    Sailwave is a windows based application that manages scoring and results for sail races and series See http://www.sailwave.com/ Sailwave comes with many different ways to ‘publish’ results, including FTP’ing the html results files to a server. Whilst there are many ways to achieve the desired results, the situation arose that my server no longer supported FTP…

  • 5 minute guide to setup process monitoring with MONIT on Linux

    If you are running a VPS, for a production server, it is very useful to have a process that monitors, and restarts if failed, and notifies you of key processes, like apache, mysql, postfix & ssh. Monit is a free open source tool that does the job. Took me a little while to get my…

  • Integrating Google Forms / Sheets to External API

    This example is of Google Forms submitting to Fresh Desk Google forms is an easy to use form builder that has  many uses.  One advantage of Google Forms is that is is effectively free, either within ‘consumer’ Google Accounts, or more importantly is business Google Apps for Work / Education / Government accounts. When automating…

  • Google Chrome extract links

    Extract links from a Google Chrome page Inspect element Go to console run urls = $$(‘a’); for (url in urls) console.log ( urls[url].href );  

  • Genesis Adding a Read More Button to Excerpts on Archives

    With Genesis when you select archives to display excerpts, you don’t get a read more link or button, just some dots. Although you can click on the title, this isn’t intuitive or user friendly. The following code snippet can handle this add_filter( ‘the_excerpt’, ‘bw_excerpt_read_more_link’ ); function bw_excerpt_read_more_link( $output ) { if( ‘post’ === get_post_type() )…