getButterfly Logo

Currently browsing the Blog category

  1. Home
  2. Blog

This is how I clean up my Ubuntu server with a weekly or monthly frequency. It also applies to Debian Linux.

A nice piece of code to use for A/B testing to look for a certain element every 50 milliseconds, execute the code when found, then clear the interval loop. If the element is not found the loop is interrupted after 15 seconds.

You can find JavaScript tabs anywhere, but only 5-10% of those are physically linkable. The script below shows you how to create such tabs without any JS library. See a Codepen demo¬†for the complete code (HTML + CSS). // JavaScript to enable link to tab var hash = document.location.hash; if (hash) { document.querySelectorAll(‘.whiskey-tabs li a[href=”‘ […]

This code snippet allows you to dynamically append a CSS file to your document’s head. It can be used inside any JavaScript code or for custom A/B tests.

This small JavaScript prototypes enhance the trim() function and allow for better trimming and/or replacing line breaks with commas (or any other character).

This is how you create an AJAX request with optional GET parameters in JavaScript. Note that you need to be on the same domain for the AJAX call to work.

This is a collection of JavaScript/jQuery snippets to validate credit card details without requiring any library. Feel free to customise it as you see fit.

This JavaScript code snippet adds inline validation to any form field (input, select and textarea). Feel free to customise it as you see fit.

A recent Wordfence investigation brought up the fact that one of my plugins, Finance Calculator, has been taken over by a spammer, Mason Soiza.

Our PHP/MySQL tutorials and code snippets allow you to extend the power of your site. Our step by step PHP/MySQL tutorials are easy to understand.

Our WordPress tutorials allow you to extend the power of WordPress. Our step by step WordPress tutorials are easy to understand and follow the WordPress best practices. These WordPress tutorials contain real-life examples, tips, and hacks that allow you to learn WordPress faster.

Here is a collection of random jQuery code snippets, created during various past projects. Note that they require the jQuery library and some require various CSS classes and/or a certain HTML structure.

Learn JavaScript in simple and easy steps starting from basic to advanced concepts with examples including JavaScript tutorials, use cases and scenarios.

This guide was built to serve as a comprehensive resource to using .htaccess. The .htaccess file is a configuration file that affects how a web server responds to various requests. It is supported by several web servers, including the popular Apache software used by most web hosting providers.

This documentation provides the basic usage of GPG/PGP, following creation of keys, encryption/decryption, generating files, sending and receiving, uploading to key servers and more.