Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
I code stuff

Christopher Gocek stettdev

⌨️
I code stuff
  • Stargard, Poland
View GitHub Profile
@stettdev
stettdev / logger.js
Last active January 31, 2022 20:07
Basic JS Logger
View logger.js
const fs = require('fs');
const logFolder = process.env.LOG_FOLDER;
// LOG_FOLDER=C:/full/path/to/folder
const filePath = (date) => `${Setup.logFolder}/${date}`;
const onError = (error) => console.error('LOG SAVING ERROR: ', error);
// display Error in console if cannot save to file
// separate files for log and error messages
const now = () => {
@stettdev
stettdev / theme.css
Last active October 4, 2021 16:06
Theme Toggle (light & dark)
View theme.css
.theme-toggle {
display: inline;
align-self: center;
}
.theme-checkbox {
opacity: 0;
display: none;
}