How to use javascript to autoloop a video within a certain time range?

HTML portion for video: <video muted=”true” autoplay=”true” class=”vid” id=”someVidName” > <source src=”[replace]” type=”video/mp4″> </video> Javascript to make loop. Note that the movie will start from beginning and play until 3.5 sec, then will loop around 1.99 and 3.5 perpetually. (function () { var vidElem = document.getElementById(‘someVidName’); console.log(vidElem); vidElem.addEventListener(“timeupdate”, function () { if (vidElem.currentTime > 3.5)…

Composer and Git Command Cheat Sheet

  composer install –ignore-platform-reqs   Commit all files (new install): git add –all git commit -am “[commit message]”   inspect all changes: git add . //stage all files changes up to that point git status //see new / modified / deleted files – splits in two sections –  staged for changes vs not stage for…

Greenshot: How to Take Screenshots and Save Very Quickly?

Greenshot makes saving a lot of screenshots very quickly. You can easily configure it to save the exact part of your screen all in one place. Here are steps below: Download, install and run Greenshot from https://ninite.com (safe and secure source for software) Right click the tray icon (Green G in the task bar ) and press…

Set WordPress to Enable Error Logging but Move Error Log Outside of /public_html/

The snippet below is for pasting into wp-config.php: to enable error logging into file debug.log, but move it outside of public_html to disable showing errors (you can switch comment below to allow display of errors)   // Enable WP_DEBUG mode define( ‘WP_DEBUG’, true ); // Enable Debug logging to the debug.log file //define( ‘WP_DEBUG_LOG’, true…

Automatically Log a User into a Specific Account in WordPress without Username / Password

This script will automatically (forcefully) log any user that loads this page into a specific wordpress account. This example logs user into an account with username “demo”.

Word of caution: Any user who finds and loads this page will be logged in. Use very carefully. Do NOT use this script to allow logging into any user account with any meaningful privileges. Do NOT use this in a production environment. This basically creates a backdoor to your wordpress site.

PHP Script – Cross Origin Resource Sharing (CORS) – Pre-flight response for the browser

This PHP snippet is to fulfill the pre-flight requirement for Cross Origin Resource Sharing (CORS) so browsers will access a resource from another domain to your server. This is useful for any APIs (restful or not), or any resource that will be called remotely. You can basically copy and paste this code. Brief explanation: Before…