Skip to content

Instantly share code, notes, and snippets.

@dan-laskowski
dan-laskowski / convert-number-to-month.js
Created August 6, 2020 12:48
[Convert Number to Month Name] #arrays #js #formatting #dates
function monthName(num) {
return new Date(2000, num - 1).toLocaleString("en-us", {month: "long"});
}
@dan-laskowski
dan-laskowski / count-syllables.js
Created August 6, 2020 12:42
[Count Syllables] #js #strings
function numberSyllables(word) {
return word.split(`-`).length
}
@dan-laskowski
dan-laskowski / additive-inverse.js
Created August 6, 2020 12:39
[Additive Inverse] #arrays #math #map #loops
function additiveInverse(arr) {
return arr.map(x => -x);
}
@dan-laskowski
dan-laskowski / rwd-embed-yt.css
Last active July 7, 2020 12:29
[Responsive YouTube Player] #youtube #responsive #embed #css #style
<style>
.iframe-container{
position: relative;
width: 100%;
padding-bottom: 56.25%;
height: 0;
}
.iframe-container iframe{
position: absolute;
top:0;