Skip to content

Instantly share code, notes, and snippets.

@astanet
astanet / gohugo.Dockerfile
Created October 30, 2020 06:08 — forked from arubacao/gohugo.Dockerfile
Install and verfiy Hugo in Docker
#**************** HUGO *********************************************
# from https://arubacao.com/install-verify-gohugo-dockerfile/
ENV HUGO_VERSION="0.75.1"
RUN set -ex \
&& curl -fsSLO --compressed "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" \
&& curl -fsSLO --compressed "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_checksums.txt" \
&& grep " hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz\$" hugo_${HUGO_VERSION}_checksums.txt | sha256sum -c - \
&& tar -xzf hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz -C /usr/local/bin/ \
&& rm hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz \
@astanet
astanet / index.js
Last active February 24, 2020 10:53
Add custom information to the Stackdriver error log in Firebase Functions.
const functions = require('firebase-functions')
const reportError = require('./reportError')
const raiseReferenceError = require('./raiseReferenceError')
const raiseSyntaxError = require('./raiseSyntaxError')
const raiseTypeError = require('./raiseTypeError')
exports.stackdriverErrorLogging = functions.https.onRequest((req, res) => {
try {
switch (Math.floor(Math.random() * 3)) {