Skip to content

Instantly share code, notes, and snippets.

View daxeh's full-sized avatar

Adrian Teh daxeh

  • Sydney, Australia
  • 07:02 (UTC +11:00)
View GitHub Profile
@daxeh
daxeh / DockerfileForSvelteKit.md
Created July 10, 2023 02:52 — forked from aradalvand/DockerfileForSvelteKit.md
Dockerfile and .dockerignore for SvelteKit:

This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have installed and configured adapter-node.

Dockerfile:

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
@daxeh
daxeh / .gitignore
Created June 23, 2021 12:49 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

@daxeh
daxeh / after_res_hooks.js
Created November 26, 2017 00:33 — forked from pasupulaphani/after_res_hooks.js
Mongoose connection best practices
var db = mongoose.connect('mongodb://localhost:27017/DB');
// In middleware
app.use(function (req, res, next) {
// action after response
var afterResponse = function() {
logger.info({req: req}, "End request");
// any other clean ups
// A Unit test template for Tape
// See 5 Questions every unit test must answer:
// https://medium.com/javascript-scene/what-every-unit-test-needs-f6cd34d9836d
import test from 'tape';
test('What are you testing?', assert => {
const msg = 'what should it do?'
const actual = 'what was the output?';