Skip to content

Instantly share code, notes, and snippets.

@shai126
shai126 / fizzbuzz.js
Created July 10, 2020 17:28
Flexible, pure FizzBuzz
//// Implementation
function play(from, to, rules) {
const lines = [];
for (let i = from; i <= to; i++) {
const message = rules
.filter(([word, predicate]) => predicate(i))
.map(([word, predicate]) => word)
.join("");
@shai126
shai126 / drip-sort-account-list.js
Last active February 4, 2019 23:59
Sort the Drip account picker dropdown alphabetically
jQuery(function() {
var $list = jQuery(".main-nav__accounts ul");
$list.children("li")
.sort(function(a, b) {
return jQuery(a).text().trim().localeCompare(jQuery(b).text().trim());
})
.appendTo($list);
});