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
const ENABLED = false // Keep this false while testing to verify that it's working correctly | |
const DELETE_INTERVAL = 1000 // Amount of time in MS to wait between deletion (more likely to fail with a small number) | |
// This filter should return a boolean (true == delete video, false == keep video) | |
const MIN_DURATION_MS = 1000 * 60 * 1.5 // 1:30 mins | |
const SHOULD_DELETE = videoElement => { | |
try { | |
// Get the duration string |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
A collection of Markdown code and tricks that were tested to work in Gist.
This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.
- Reformat this whole document and assimilate these:
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
#!/usr/bin/env node | |
console.log('yay gist') |
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
function monitorEvents(element) { | |
var log = function(e) { console.log(e);}; | |
var events = []; | |
for(var i in element) { | |
if(i.startsWith("on")) events.push(i.substr(2)); | |
} | |
events.forEach(function(eventName) { | |
element.addEventListener(eventName, log); | |
}); |
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
# shells are an orchestration environment | |
# the language they provide is intended to orchestrate processes | |
# on the operating system | |
# if programs are functions, then all of the below are variants of function application | |
# anonymous pipe | |
echo "string" | cat | |
# herestring | |
cat <<< "string" |
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
import httplib | |
import socket | |
import StringIO | |
# generic | |
SSDP_ALL = 'ssdp:all' | |
UPNP_ROOT = 'upnp:rootdevice' | |
# devices | |
DIAL = 'urn:dial-multiscreen-org:service:dial:1' |
NewerOlder