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 mp3 { curl "https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&q=$1+$2&type=video&fields=items(id(videoId))&key={{APIKEY}}" | jq -r '.items|.[0]|.id|.videoId' | xargs -I {} sh -c "youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v={}"; } | |
export -f mp3 |
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
'use strict'; | |
/** | |
* AWS Module: Action: Lambda Handler | |
* "Your lambda functions should be a thin wrapper around your own separate | |
* modules, to keep your code testable, reusable and AWS independent" | |
*/ | |
require('jaws-core-js/env'); |
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
so, I had this tool valid_edtf.py that validated the format of a very particular date string we use in the libraries. its just a standard way to resolve whether the date was valid in regards to the spec. the view has a json response that comes back true or false, and depending on the result, the js writes a little message in the template after an 'onkeyup' event (user types date into form). | |
=== | |
js | |
=== | |
$(function(){ | |
$("#edtfform").validate({ | |
rules: { | |
date: { |