Skip to content

Instantly share code, notes, and snippets.

View TehShrike's full-sized avatar
🕺
Groovy.

Josh Duff TehShrike

🕺
Groovy.
View GitHub Profile
@TehShrike
TehShrike / reproduction.ts
Created October 31, 2018 16:04
deno issue
const main = async () => {
const getResponse = await fetch('https://postman-echo.com/get', {
headers: {
'User-Agent': 'test'
}
})
console.log('GET response:', await getResponse.text())
const postResponse = await fetch('https://postman-echo.com/post', {
@TehShrike
TehShrike / Preface.md
Last active April 4, 2023 19:12
Bible Acrostic: An Aid to Memorizing the Content of Every Chapter of the Bible

Preface

The source material for this booklet was given to me by a trusted Pastor/friend. He mentioned it in the context of a discussion about a feat that may seem audacious... to memorize the content of every chapter of the Bible.

(For helpful guidelines and encouragement for Extended Memorization, see Rev. Andrew Davis’ Written on Your Heart: An Approach to Extended Memorization of Scripture. Many of his principles are applicable to this Book/Chapter summary memorization task; the main lesson being PRACTICE.)

Well, I am one for adventurous and ambitious (if not audacious) endeavors, so I produced this booklet as I proceeded through a read- the-Bible-in-a-year reading program with my family. When we read each morning and evening I learned that day’s phrases.

*(Much of the year I was right on track with my memorization and when I fell behind a few days it wasn’t too hard to catch up. All told, I accomplished my goal but of course now (and for the years to come) I need to continue to practice in order

@TehShrike
TehShrike / wrap-commonjs.js
Created February 9, 2019 21:59
Wrap CommonJS into a UMD-like thingy
const yourModule = (() => {
const module = { exports: {} }
/* your module here */
module.exports = {
test: true,
}
/* end your module */
@TehShrike
TehShrike / eslint cli arguments.txt
Last active August 11, 2022 16:11
Ignore fixable eslint rules
eslint --rule 'no-extra-boolean-cast: 0' --rule 'no-extra-parens: 0' --rule 'no-extra-semi: 0' --rule 'no-regex-spaces: 0' --rule 'no-unsafe-negation: 0' --rule 'curly: 0' --rule 'dot-location: 0' --rule 'dot-notation: 0' --rule 'eqeqeq: 0' --rule 'no-else-return: 0' --rule 'no-extra-bind: 0' --rule 'no-extra-label: 0' --rule 'no-floating-decimal: 0' --rule 'no-implicit-coercion: 0' --rule 'no-multi-spaces: 0' --rule 'no-unused-labels: 0' --rule 'no-useless-return: 0' --rule 'wrap-iife: 0' --rule 'yoda: 0' --rule 'strict: 0' --rule 'no-undef-init: 0' --rule 'array-bracket-newline: 0' --rule 'array-bracket-spacing: 0' --rule 'array-element-newline: 0' --rule 'block-spacing: 0' --rule 'brace-style: 0' --rule 'capitalized-comments: 0' --rule 'comma-dangle: 0' --rule 'comma-spacing: 0' --rule 'comma-style: 0' --rule 'computed-property-spacing: 0' --rule 'eol-last: 0' --rule 'func-call-spacing: 0' --rule 'function-paren-newline: 0' --rule 'implicit-arrow-linebreak: 0' --rule 'indent: 0' --rule 'jsx-quotes: 0' --ru
@TehShrike
TehShrike / command.sh
Created July 4, 2019 11:50
Sublime Text as git editor
git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n -w"
@TehShrike
TehShrike / daysInMonth.js
Last active January 10, 2020 19:43
daysInMonth.js
// 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()
}
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`)
@TehShrike
TehShrike / weekday-names.js
Created January 21, 2020 23:04
The names of the days of the week using browser locale
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)
@TehShrike
TehShrike / date-range-input.js
Last active July 24, 2023 17:39
Svelte custom element wrapper
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>",
@TehShrike
TehShrike / .eslintrc.js
Last active November 16, 2020 15:27
.eslintrc.js
const warn = [ 'warn' ]
const error = [ 'error' ]
const never = [ 'warn', 'never' ]
const always = [ 'warn', 'always' ]
const asNeeded = [ 'error', 'as-needed' ]
module.exports = {
plugins: [
// 'html',