This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "videoTag" is <video> element pulled from the DOM | |
var videoPercentageRate = this.duration / 100; | |
var videoCompletionRateIntervals = [25,50,75,100]; | |
videoTag.play = function() { | |
var percentageCompleted = (videoTag.currentTime / videoTag.duration) * 100 | |
console.log(percentageCompleted); | |
if (percentageCompleted >= videoCompletionRateIntervals[0]) { | |
console.log(videoCompletionRateIntervals[0], '% of video completed'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "videoTag" is <video> element pulled from the DOM | |
var videoPercentageRate = this.duration / 100; | |
var videoCompletionRateIntervals = [25,50,75,100]; | |
videoTag.play = function() { | |
var percentageCompleted = (videoTag.currentTime / videoTag.duration) * 100 | |
console.log(percentageCompleted); | |
if (percentageCompleted >= videoCompletionRateIntervals[0]) { | |
console.log(videoCompletionRateIntervals[0], '% of video completed'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Little script/function to get time intervals | |
*/ | |
// Based on: | |
// https://stackoverflow.com/a/19225446/808870 | |
const diffInHours = (startDate, endDate) => ( endDate.valueOf() - startDate.valueOf() ) / 1000 / 60 / 60; | |
const getTimeIntervalsPerHour = interval => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Just shows props as JSON, To be used for testing and as a stub/placeholder | |
const ShowJSON = (props) => { | |
return ( <pre> | |
{JSON.stringify(props)} | |
</pre> ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Little script to update date based on SO answer here: https://askubuntu.com/a/655528/158714 | |
* but with more security in mind (as that answer just feeds the output right into bash) | |
* | |
* Useful for little VMs when NTP is blocked and you put VMs into saved state regularly/ | |
* | |
* Run via cron as root or other privileged user. | |
* | |
* Robert Dundon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Git proxy settings | |
echo "Configuring Git for compatibility with ZScaler..." | |
git config --global http.proxy http://gateway.zscaler.net:80/ | |
git config --system http.proxy http://gateway.zscaler.net:80/ |