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 / hdiutil_output
Created December 18, 2014 17:36
plist output from hdiutil trying to attach an image
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>system-entities</key>
<array>
<dict>
<key>dev-entry</key>
<string>/dev/disk3</string>
<key>mount-point</key>
import { AppThunk } from "../configureStore"
import { RootState } from "./reducer"
// appStatus.js
const GOOGLE = "google"
const MAPBOX = "mapbox"
// App Status Actions
export const APP_IS_LOADED = 'mapping/app/isLoaded'
export const APP_IS_THINKING = 'mapping/app/appIsThinking'
import { DirectionsResponse } from "@googlemaps/google-maps-services-js"
export const foo: DirectionsResponse = { status: 200,
statusText: 'OK',
headers:
{ 'content-type': 'application/json; charset=UTF-8',
date: 'Fri, 05 Jun 2020 22:25:12 GMT',
pragma: 'no-cache',
expires: 'Fri, 01 Jan 1990 00:00:00 GMT',
'cache-control': 'no-cache, must-revalidate',
@tim-rohrer
tim-rohrer / App.ts
Created June 16, 2020 21:04
My express app
import express from 'express';
import FetchGoogleRoutes, { FetchRoutesParams } from './FetchGoogleRoutes';
import { Client } from '@googlemaps/google-maps-services-js';
class App {
public express: express.Application;
public fetch: FetchGoogleRoutes;
constructor() {
parsePDFStatement = async () => {
try {
const pdfPath = this.setPDFPath();
const loadingTask = this.pdf.getDocument(pdfPath);
await loadingTask.promise
.then((doc) => {
const { numPages } = doc;
console.log("# Document Loaded");
console.log(`Number of Pages: ${numPages}`);
console.log();
window.google = {
maps: {
DirectionsService: class {
route() {}
},
DirectionsStatus: {
INVALID_REQUEST: 'INVALID_REQUEST' as google.maps.DirectionsStatus.INVALID_REQUEST,
MAX_WAYPOINTS_EXCEEDED: 'MAX_WAYPOINTS_EXCEEDED' as google.maps.DirectionsStatus.MAX_WAYPOINTS_EXCEEDED,
NOT_FOUND: 'NOT_FOUND' as google.maps.DirectionsStatus.NOT_FOUND,
OK: 'OK' as google.maps.DirectionsStatus.OK,
{
"extends": "@tsconfig/node16/tsconfig.json",
"compilerOptions": {
"rootDir": "./",
"preserveConstEnums": true,
"lib": [
"DOM"
],
"types": [
"jest"
{
"root": true,
"env": {
"browser": false,
"es2021": true,
"jest": true
},
"settings": {
"import/resolver": {
"node": {
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){
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",