Tag: cheatsheet

  • WordPress CheatSheet

    Force add SSL / HTTPS without plugin First make sure that your wordpress site has WordPress Address (URL) and Site Address (URL) set to a https:// version in Settings > General. Fix redirect loop on WordPress https version Then if you go into a redirect loop while trying to reach https version, add this code […]

  • Redirect CheatSheet

    This page lists methods to redirect a webpage using various technologies. How to redirect webpage using PHP How to redirect webpage using JavaScript How to redirect using on webpage using html meta http-equiv

  • PHP CheatSheet

    Enable Error Display in PHP PDO CheatSheet This section includes cheatsheet of PDO. PHP PDO execute() returning duplicate results This can be solved by using FETCH_ASSOC with both fetch() or fetchAll() function. Note that you might need to use \PDO depending upon namespacing in your project, especially if it gives fatal error. PDO::FETCH_ASSOC not working […]

  • PHP OOP Concepts CheatSheet

    What is a class property A class property is just like a variable, but declared inside a class (at base level, not inside a function / method). For example: What is a class method Method is simply a function inside a class. For example: PHP OOP Encapsulation Encapsulation simply means making the data private and […]

  • CSS CheatSheet

    How to remove outline around focused input box or textarea CSS animation CSS animation fade in an element CSS animations don’t work on display property, so we can’t use keyframes to make an element display: none to display: block or anything else. Instead, we can use opacity. Example code would look like this: CSS transitions

  • JavaScript Cheatsheet

    ForEach loop in javascript: Export & Import modules in JavaScript ES6 (node / react / nextjs) We can export multiple items from a single file in javascript ES6 module. Check following examples, all can happen in one file. Note that we also have one default export, also one “as” export (see below on how to […]

  • Discordjs Cheatsheet

    HelloWorld discordjs bot The very basic hello world bot can be coded by copying this: This bot will respond with pong when the user messages ping in the channel. Make sure that you add the token from discord developers section for this bot. Check if bot can assign a role to users This needs 2 […]

Hire Me!