This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import test from 'lib/tester'; | |
const parse_csv_line = (line: string): string[] => { | |
const chunks: string[] = []; | |
let inside_quotes = false; | |
let current_chunk = ''; | |
for (let i = 0; i < line.length; ++i) { | |
const char = line[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tz_tokenize_date from './tz_tokenize_date.mjs' | |
const ZERO_HOUR_UTC = `T00:00:00.000Z` | |
const ZERO_HOUR_MINUS_TWENTY_HOURS_UTC = `T00:00:00.000-20:00` | |
const ZERO_HOUR_PLUS_TWENTY_HOURS_UTC = `T00:00:00.000+20:00` | |
export const day_to_offset_at_start_of_day = (iana_timezone_string, iso_day_string) => { | |
const valid_offset = [ | |
iso_day_string + ZERO_HOUR_MINUS_TWENTY_HOURS_UTC, | |
iso_day_string + ZERO_HOUR_UTC, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 cup water | |
1Tbsp active yeast | |
1tsp honey | |
2 eggs, room temperature, slightly beaten | |
1 cup oat fiber | |
2/3 cup ground golden flax meal | |
1 cup vital wheat gluten | |
1/2tsp xanthum gum | |
1tsp salt | |
2Tbsp softened butter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://github.com/bsvetlik/date-fns-tz/blob/eb2bb6209931c5abe1cfcdf2faaa41de5493648a/src/_lib/tzParseTimezone/index.js#L86-L98 | |
export default (iana_timezone_string, date_object) => { | |
const [ year, month, day, hour, minute, second ] = tz_tokenize_date( | |
date_object, | |
iana_timezone_string, | |
) | |
const asUTC = Date.UTC(year, month - 1, day, hour, minute, second, date_object.getMilliseconds()) | |
return asUTC - date_object.getTime() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const warn = [ 'warn' ] | |
const error = [ 'error' ] | |
const never = [ 'warn', 'never' ] | |
const always = [ 'warn', 'always' ] | |
const asNeeded = [ 'error', 'as-needed' ] | |
module.exports = { | |
plugins: [ | |
// 'html', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DateRangeInput from "@equipmentshare/date-range-input" | |
import makeCeFromSvelte from "common/svelte-ce" | |
export default makeCeFromSvelte(DateRangeInput, { | |
mirrorProps: [ "start", "end", "visibleStartMonth", "visibleEndMonth" ], | |
requiredToInstantiate: [ "start", "end" ], | |
mirrorEvents: [ "change" ], | |
// Shouldn't be necessary now that https://github.com/sveltejs/svelte/issues/3940 is fixed | |
initialHtml: "<style>@import './date-range-input/component.css';</style>", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const anArbitrarySundayEarlyInTheMonth = new Date(2020, 0, 5) | |
const dayNumbers = [ 0, 1, 2, 3, 4, 5, 6 ] | |
const formatter = new Intl.DateTimeFormat(undefined, { | |
weekday: `short`, | |
}) | |
const weekdayNames = dayNumbers.map(dayNumber => { | |
const date = new Date(anArbitrarySundayEarlyInTheMonth) | |
date.setDate(date.getDate() + dayNumber) | |
return formatter.format(date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Jimp = require(`jimp`) | |
const imagemin = require('imagemin') | |
const imageminPngquant = require('imagemin-pngquant') | |
const { readdirSync } = require(`fs`) | |
const { join } = require(`path`) | |
const relativeToThisFile = relativePath => join(__dirname, relativePath) | |
const inputPath = relativeToThisFile(`../../book-cover-image`) | |
const outputPath = relativeToThisFile(`../../Markdown/Web/book-image/thumbnail`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An expansion of https://stackoverflow.com/a/1184359/201789 | |
function daysInMonth (oneIndexedInputMonth, year) { | |
const zeroIndexedInputMonth = oneIndexedInputMonth - 1 | |
const theNextZeroIndexedMonth = zeroIndexedInputMonth + 1 | |
const theFinalDayOfThePreviousMonth = 0 | |
return new Date(year, theNextZeroIndexedMonth, theFinalDayOfThePreviousMonth).getDate() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n -w" |
NewerOlder