Skip to content

Instantly share code, notes, and snippets.

View tjunghans's full-sized avatar
💭
Open for business

Thomas Junghans tjunghans

💭
Open for business
View GitHub Profile
@tjunghans
tjunghans / node-v8-max-old-space-size.md
Last active November 18, 2023 20:17
Node V8 max-old-space-size

Node V8 Option max-old-space-size

Command line

node --help --v8-options | grep -B 1 -A 1 max-old-space
        type: bool  default: false
  --max-old-space-size (max size of the old space (in Mbytes))
        type: size_t  default: 0
@tjunghans
tjunghans / using-the-sass-migrator-in-monorepo.md
Last active March 12, 2020 13:08
Using the sass-migrator in monorepo

#Using the sass-migrator in monorepo

sass/migrator#68

// @use "../../../package/browser/css/file"; // alternative solution
@use "~package/browser/css/file";

Calling the migrator in the root directory, which is the same directory of packages/node_modules and node_modules will only find

@tjunghans
tjunghans / History\-7199209e\entries.json
Last active September 8, 2022 14:37
vscode-settings.json
{"version":1,"resource":"file:///h%3A/Digital-Clock-main/Digital-Clock-main/script.js","entries":[{"id":"m8wb.js","timestamp":1662637426203},{"id":"kcQL.js","source":"undoRedo.source","timestamp":1662637430965}]}
@tjunghans
tjunghans / TJ.code-snippets
Created April 6, 2020 10:47
JavaScript, Typescript and React VSCode snippets
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
(function () {
"use strict";
const table = document.querySelector("table");
if (table) {
const thead = table.querySelector("thead");
const tbody = table.querySelector("tbody");
// create "Path" header column
@tjunghans
tjunghans / Summary-Notes-On-Secure-User-Auth.md
Last active September 6, 2021 19:57
Summary Notes on "Implementing Secure User Authentication in PHP Applications with Long-Term Persistence"

Summary Notes on "Implementing Secure User Authentication in PHP Applications with Long-Term Persistence"

Source

  • Secure Authentication is hard

Secure Password Storage in 2015

Passwords: Hashes, Salts, and Policies

@tjunghans
tjunghans / esm-default-exports.md
Created November 23, 2021 10:52
ESM Default exports

This is something a think about a lot. I a while ago I browsed the Pure ESM package gist by Sindresorhus and there's one point When should I use a default export or named exports?.

He suggests:

My general rule is that if something exports a single main thing, it should be a default export.

There's also this:

Why use default exports at all? Simplify usage: Having a default export simplifies import when the person importing the module just wants the obvious thing from there. There’s simply less syntax and typing to do.

#!/usr/bin/env node
const { readdir, writeFile } = require("fs");
const { promisify } = require("util");
function createDirEntry(dir) {
return { name: dir, path: `packages/node_modules/${dir}` };
}
function createProjectCodeWorkspaceContents(dirs) {
@tjunghans
tjunghans / .editorconfig
Created March 17, 2023 22:22
.editorconfig
# EditorConfig is awesome: https://editorconfig.org/
root = true
[*]
charset = utf-8
indent_style = space
end_of_line = lf
indent_size = 2
insert_final_newline = true