Headers added by chrome...
Going direct to the PNG:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
When linked from img
tag in an html page:
image/webp,image/*,*/*;q=0.8
Headers added by chrome...
Going direct to the PNG:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
When linked from img
tag in an html page:
image/webp,image/*,*/*;q=0.8
import { writeFileSync, mkdirSync, existsSync } from 'fs' | |
import { resolve } from 'path' | |
import * as ts from 'typescript' | |
function checkForTypeErrors(jsonContent: string) { | |
const tempDir = resolve('.tmp') | |
const tempFilePath = resolve(tempDir, 'typecheck.ts') | |
if (!existsSync(tempDir)) { | |
mkdirSync(tempDir) | |
} |
My method for storing and backing up photos is as follows:
Archive
folder, in a folder for the current year, with the batch folder name starting with the date.Best
folder using the same folder names, but not grouped into years.Best
folder is backed up to a second local disk, and an offsite location (AWS Glacier).Archive
folder is only backed up onto a second local replicated disk.#!/bin/bash | |
# Note: Depends on having jq and AWS CLI installed: `brew install jq`, `brew install awscli` | |
set -e # stop on error | |
AWS_ACCOUNT="1234567890" | |
AWS_USERNAME="YOUR_AWS_USERNAME" | |
MFA_SERIAL="arn:aws:iam::$AWS_ACCOUNT:mfa/$AWS_USERNAME" | |
export AWS_CONFIG_FILE='/dev/null' # ignore config file so CLI doesn't pick up MFA config | |
read -p "Enter MFA code for $MFA_SERIAL: " MFA |
This is my process for addint ESLint and Prettier support for a new Pulumi TypeScript project.
yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-airbnb-base eslint-config-prettier eslint-plugin-import eslint-plugin-prettier prettier
import * as pulumi from '@pulumi/pulumi'; | |
import { exec, ExecOptions } from 'child_process'; | |
export type ExecArgs = { | |
command: pulumi.Input<string>; | |
options?: pulumi.Lifted<ExecOptions>; | |
}; | |
export class Exec extends pulumi.ComponentResource { | |
stdout: pulumi.Output<string>; |
import React, { useEffect, useRef } from 'react'; | |
import { Location } from '@reach/router'; | |
import { register } from '../serviceWorker'; | |
/** | |
* Include this component around your router to register a service worker to cache the application | |
* so it works offline. Then, when the application has automatically updated itself, intercept the | |
* Reach router location change and do a hard browser navigation to enble the application updates | |
* to be applied. | |
* @example |
When returning a number from a UDF function which is greater than 2,147,483,647 but less than long.MaxValue and bound to a Stream Analytics bigint type then the number is shown as a negative which indicates that the integer has been overflowed. This error does not happen when using the local or portal query tester.
The workaround we've used to return the value as a string. However, this behaviour does not match the documentation: https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-javascript-user-defined-functions#stream-analytics-and-javascript-type-conversion
/** | |
* Annotated, real-world example of how to use | |
* AWS API Gateway V2 + JWT authorizer + Cognito | |
* with support for CORS & good security practices | |
* deployed with Pulumi (https://www.pulumi.com/) | |
*/ | |
import * as pulumi from '@pulumi/pulumi'; | |
import * as aws from '@pulumi/aws'; | |
import serverlessExpress from '@vendia/serverless-express'; | |
import express from 'express'; |
example.md