Skip to content

Instantly share code, notes, and snippets.

@cbebry
cbebry / Dockerfile-web
Created April 12, 2023 08:31
Matomo docker basics
FROM php:8.0-apache
# Install necessary packages
RUN apt-get update && \
apt-get install -y mariadb-client && \
apt-get install -y libcurl4-openssl-dev && \
apt-get install -y libz-dev && \
apt-get install -y libpng-dev && \
apt-get install -y libxml2-dev && \
apt-get install -y libonig-dev && \
@cbebry
cbebry / bad combinatorics
Created March 27, 2015 03:27
bad combinatorics
// Base Sets
// A configuration of seven notes spanning an octave
// One base set contains seven modes
// The only intervals can be H, W, or 1.5 (1, 2, 3 respectively)
var templateSets = [
#!/bin/bash
echo "Finding latest version."
VERSION=`curl -s http://nodejs.org/dist/latest/SHASUMS.txt | awk '/node-v/ {print $2}' | head -1 | sed s/node-v// | sed s/-/\ / | awk '{print $1}'`
echo "Preparing to install node-v$VERSION"
url="http://nodejs.org/dist/v"$VERSION"/node-v"$VERSION".tar.gz"
echo "GET" $url
curl $url | tar -zxf -
<VirtualHost *:80>
ServerName projects.littlestreamsoftware.com
RewriteEngine On
# Redirect any non HTTPS requests to the HTTPS server
RewriteCond %{HTTP_HOST} ^projects.littlestreamsoftware.com$ [NC]
RewriteRule ^(.*)$ https://projects.littlestreamsoftware.com$1 [R=301,L]
Include /etc/apache2/common/hide-svn

Node Error Handling and Domains

"Occurrences in this domain are beyond the reach of exact prediction because of the variety of factors in operation, not because of any lack of order in nature." - Albert Einstein

"Master of my domain" - Larry David

Error handling in an asynchronous language works in a unique way and presents many challenges, some unexpected. This tutorial reviews the various error handling patterns available in node, and explains how domains can be used to improve it.

There are four main error handling patterns in node:

  • Error return value
set :application, "SampleApp"
set :repository, "."
set :scm, :none
set :use_sudo, false
set :keep_releases, 5
#Use the copy method which will compress and scp the files
set :deploy_via, :copy
set :main_js, "app.js"