Skip to content

Instantly share code, notes, and snippets.

View wilmoore's full-sized avatar

Wil (₩) Moore III wilmoore

View GitHub Profile
@wilmoore
wilmoore / readme.md
Last active February 13, 2025 07:03
Song Link Translator

https://music.apple.com/us/album/eyes-closed/1711434525?i=1711434708

Use the link only for reference; given the uploaded screenshot, extract the song title and artist.

It should be obvious which song to detect because the screenshot should depict either a single song or in cases where there’s more than one song, use the song that is selected or playing.

Next, craft direct song URLs (not search links) and render them as clickable links for the following platforms: • Spotify • YouTube • SoundCloud

@wilmoore
wilmoore / index.js
Last active September 26, 2024 14:36
Flattens a nested array recursively (A quick ES6 prototype of my https://www.npmjs.com/package/flatten-arr)
const toString = Object.prototype.toString
/**
* Recursive list item concatenation.
*
* @param {Array} nested
* Nested array.
*
* @param {Array} flat
* Initial/Flattended array.
@wilmoore
wilmoore / promiseWhile
Last active September 26, 2024 14:34
Software Engineering :: Programming :: Languages :: JavaScript :: Example :: Promise loop (can use as a long-running worker) with predicate
/**
* Hat Tip: https://gist.github.com/victorquinn/8030190#gistcomment-1615901
*/
'use strict'
var Promise = require('bluebird')
var times = 0
function promiseWhile (predicate, action) {
@wilmoore
wilmoore / 01-composition-pipeline.js
Last active September 26, 2024 14:31
Software Engineering :: Programming :: Languages :: JavaScript :: Example :: Functional Programming Fundamentals Code
'use strict'
const assert = require('assert')
function words (text) {
return text.split(/\s+/)
}
function reverse (list) {
return list.reverse()
@wilmoore
wilmoore / first-go.md
Last active July 25, 2024 03:59
Software Engineering :: Programming :: Languages :: GoLang :: Your First Go Program

Software Engineering :: Programming :: Languages :: GoLang :: [Your First Go Program]

⪼ Made with 💜 by Polyglot.

research

[Your First Go Program]

create a project directory

@wilmoore
wilmoore / aws-s3-static-put.sh
Last active May 4, 2024 05:59
Software Engineering :: Cloud :: AWS :: Amazon S3 :: AWS s3 Static File Deployment
#!/usr/bin/env bash
# bucket name
BUCKET_NAME="TARGET-BUCKET-HERE"
# create bucket (idempotent)
s3cmd mb s3://$BUCKET_NAME
# put index.html
s3cmd put --acl-public index.html s3://$BUCKET_NAME/index.html
@wilmoore
wilmoore / policy.json
Last active May 4, 2024 05:57
Software Engineering :: Cloud :: AWS :: Amazon S3 :: Creating S3 Virtual Directories w/ s3cmd and curl
{"expiration": "2015-01-01T00:00:00Z",
"conditions": [
{"bucket": "filemanager-curl"},
["starts-with", "$key", ""],
{"acl": "public-read"},
["starts-with", "$Content-Type", ""],
["content-length-range", 0, 1048576]
]
}
@wilmoore
wilmoore / metadata.json
Last active May 4, 2024 05:56
Software Engineering :: Cloud :: AWS :: Amazon S3 :: AWS/S3 API Object Reference
{
"StorageClass": "STANDARD",
"LastModified": "2012-01-29T00:39:56.000Z",
"Owner": {
"DisplayName": "root+customerassets",
"ID": "c84f7ff82a000e3b0670cb3ae678182d91f0f83e59bc11e90ce734862dbf482c"
},
"ETag": "\"f7106b9a8942697c67342caef1548a8c\"",
"Size": "24349",
"Headers": {
@wilmoore
wilmoore / index.html
Last active April 30, 2024 18:59
Software Engineering :: Programming :: Languages :: JavaScript :: ECMAScript :: ES6 :: ES6-driven Sequence Diagram Editor
<style id="jsbin-css">
body {
background-color: #ffffff;
}
</style>
<meta name="description" content="ES6-driven Sequence Diagram Editor" />
<body>
<div id="output"></div>
<script src="http://google.github.io/traceur-compiler/bin/traceur.js"></script>
<script src="http://google.github.io/traceur-compiler/src/bootstrap.js"></script>
@wilmoore
wilmoore / readme.md
Last active February 11, 2024 22:32
UMD-inspired Module Boilerplate

UMD-Inspired JS Module Boilerplate

This is the module format you don't know you need until you need it. Write your module once and have it work in a CJS/NodeJs, AMD, YUI (v3+), or Browser Global environment.

Best Used When...

  • You are migrating from namespaced (err, globals) code to either AMD or CJS modules or both.
  • You can't yet factor out browser globals but also need to test your code via NodeJS (e.g. Mocha).

Benefits & Trade-offs