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 logger(strings,...values) { | |
var str = ""; | |
for (let i = 0; i < strings.length; i++) { | |
if (i > 0) { | |
if (values[i-1] && typeof values[i-1] == "object") { | |
if (values[i-1] instanceof Error) { | |
if (values[i-1].stack) { | |
str += values[i-1].stack; | |
continue; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script type="module"> | |
import { h, text, app } from "https://unpkg.com/hyperapp" | |
app({ | |
init: () => 0, | |
view: state => | |
h("main", {}, [ |
Original was from Reduce Advanced of funfunfunction. It was a great example, but I thought it could use a bit more of the ES6 goodness like template literals, destructuring, and the spread operators.
Also the reduced form is a more "pure" functional implementation since it doesn't mutate the original object with evil functions like push
, but instead returns new data every time. A JS Bin is available to run and play with the modified version.
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
#!/bin/bash | |
mkdir -p /opt/bin | |
curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose | |
chmod +x /opt/bin/docker-compose |