Skip to content

Instantly share code, notes, and snippets.

View yeahdef's full-sized avatar

Joey Liechty yeahdef

  • Bloomreach
  • Dallas, TX
View GitHub Profile
@yeahdef
yeahdef / gist:88e446a235feaf9ba1f37f364a07ecc8
Created May 6, 2021 23:15
get first youtube hit and save as mp3 bash_profile function
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
'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');
@yeahdef
yeahdef / ajax_simple
Created September 10, 2014 18:38
very simple ajax boolean display
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: {