Skip to content

Instantly share code, notes, and snippets.

View tim-rohrer's full-sized avatar

Tim Rohrer tim-rohrer

View GitHub Profile
@tim-rohrer
tim-rohrer / createStartDateUTC.js
Last active January 15, 2024 18:08
Provides code that can be used to generate startDateUTC based on a provided date
/**
* These are snippets/functions of code used in another app to migrate meeting data from Central to
* an experimental database used by Central Query.
*/
import { DateTime } from "luxon"
enum Weekdays {
MONDAY = 1,
TUESDAY,
➜ move2gnucash git:(main) ✗ tree
.
├── LICENSE
├── Pipfile
├── Pipfile.lock
├── README.md
├── build
│   ├── bdist.macosx-12.0-x86_64
│   └── lib
│   └── move2gnucash
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.7.22) 21 AUG 2022 01:55
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**main.tex
(./main.tex
LaTeX2e <2022-06-01> patch level 5
L3 programming layer <2022-07-15> (/usr/local/texlive/2022/texmf-dist/tex/latex
/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
@tim-rohrer
tim-rohrer / setupMongoDbServices.ts
Last active July 26, 2022 01:21
Draft MongDB setup
import * as MongoDB from "mongodb"
import { QuickenImportModel } from "./storage.types.js"
let db: MongoDB.Db
let quickenCollection: MongoDB.Collection<QuickenImportModel>
export const setupDatabaseServices = async () => {
const env = process.env.NODE_ENV || "development"
const isDevelopment = env === "development" || "test"
import { ParsedData } from "quicken-investment-parser/dist/QuickenInvestmentParser"
import { OkImpl } from "ts-results-es"
import { getMockReq, getMockRes } from "@jest-mock/express"
import { jest } from "@jest/globals"
beforeEach(() => {
jest.resetAllMocks()
})
@tim-rohrer
tim-rohrer / index.d.ts
Last active July 21, 2022 21:00
Declaration for mongo-curry
// Type definitions for mongo-curry v0.1.1
// Project: https://gitlab.com/Creplav/mongo-curry
// Definitions by: Tim Rohrer <https://github.com/tim-rohrer>
// Gratitude for: @BobobUnicorn#9999 in Discord The Coding Den
import * as MongoDB from "mongodb"
type FindAllItemsInCollection<TSchema> =
(collection: MongoDB.Colection<TSchema>) => () => Promise<MongoDB.WithId<TSchema>[]>;
type FindItemByIdInCollection<TSchema> =
@tim-rohrer
tim-rohrer / CurrencyCode.enum.ts
Last active March 22, 2022 16:45 — forked from Crownie/CurrencyCode.enum.ts
Currency Code enums for Typescript
export enum CurrencyCode {
USD = 'USD',
CAD = 'CAD',
EUR = 'EUR',
AED = 'AED',
AFN = 'AFN',
ALL = 'ALL',
AMD = 'AMD',
ARS = 'ARS',
AUD = 'AUD',
import { config, DotenvConfigOutput, DotenvParseOutput } from "dotenv"
import { Err, Ok, Result } from "ts-results"
import Logger from "./logger"
export class AppConfiguration {
private static instance: AppConfiguration = new AppConfiguration()
private static requiredEnvVars: ReadonlyArray<string> = [
"GATEWAY_NS",
"GOOGLE_API_KEY",
"GOOGLE_USER_EMAIL",
import { config, DotenvConfigOutput, DotenvParseOutput } from "dotenv"
import { Err, Ok, Result } from "ts-results";
export class AppConfiguration {
private static instance: AppConfiguration = new AppConfiguration()
private static requiredEnvVars = [ "GATEWAY_NS", "GOOGLE_API_KEY", "MONGODB_URI", "SECRET_KEY"]
private static envs = {}
private constructor() {
if(AppConfiguration.instance){
{
"root": true,
"env": {
"browser": false,
"es2021": true,
"jest": true
},
"settings": {
"import/resolver": {
"node": {