divot — лунка, пробой
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
// TS | |
function test<T extends unknown>(actual: T, expected: T, text?: string): void { | |
function difference<D>(a: Set<D>, b: Set<D>) { | |
const arr: D[] = []; | |
a.forEach(d => arr.push(d)); | |
return new Set<D>(arr.filter(x => !b.has(x))); | |
} | |
function same<S extends unknown>(o1: S, o2: S): boolean { | |
const t1 = typeof o1; | |
const t2 = typeof o2; |
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
function createQueue() { | |
let head = undefined; | |
let tail = head; | |
function isEmpty() { return head === undefined; } | |
function push(value) { | |
const newElement = { next: undefined, value }; | |
if (!tail) { | |
head = newElement; | |
tail = newElement; |
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
function createStack() { | |
const empty = { next: undefined, value: undefined! }; | |
let top = empty; | |
function isEmpty() { return top === empty; } | |
function push(v) { top = { next: top, value: v }; } | |
function pop() { | |
if (!top.next) throw new Error('Can not pop from empty'); | |
const { value } = top; | |
top = top.next; | |
return value; |
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
function sumUp(t) { | |
const classes = t.split('\n').filter(l => l?.length > 9); | |
const r = /\((?<minutes>\d+)\:(?<seconds>\d+)(\s\))/; | |
const totalSeconds = classes | |
// parse each line | |
.map(s => r.exec(s)?.groups) | |
// ignore unparsed | |
.filter(Boolean) | |
// convert to seconds |
I hereby claim:
- I am another-guy on github.
- I am anotherguy (https://keybase.io/anotherguy) on keybase.
- I have a public key whose fingerprint is BA83 F183 5AD6 EB4E 8CBB FFB9 6156 FBC1 FEC5 5898
To claim this, I am signing this object:
Name | What's there | Address |
---|---|---|
Get Hot Yoga | Warm Vinyasa. Hot Hatha. | 27203 216th Ave SE Suite 7 :: Maple Valley, WA 98038 |
Elev8 | Vinyasa. Hatha. Pilates. | 2000 314th Street :: Federal Way, Washington 98003 |
evolve | Vinyasa Flow | 223 1st Ave S :: Kent, WA 98032 |
lonevita | Ashtanga ...? | 201 Auburn Way N Suite A :: Auburn, WA, 98002 |
corestar pilates | ??? | 205 East Main Street :: Suite B Auburn, WA 98002 |
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
alias cs="less ~/.cheat-sheet.txt" | |
alias gbl="git blame " | |
alias gch="git checkout " | |
alias gchb="git checkout -b " | |
alias gcl="git clone " | |
alias gcm="git commit " | |
alias gcma="git commit --amend " | |
alias gcp="git cherry-pick " | |
alias gdd="git add " | |
alias gdf="git diff " |
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
.then(jestCliCallResult => { | |
jestCliCallResult.results.testResults | |
.forEach(testResult => { | |
testResult.testResults | |
.filter(assertionResult => assertionResult.status === 'passed') | |
.forEach(({ ancestorTitles, title, status }) => { | |
console.info(` ● ${ancestorTitles} › ${title} (${status})`); | |
}); | |
}); |
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 { runCLI } from 'jest-cli'; | |
const path = require('path'); | |
const jestTestRunnerForVSCodeE2E: ITestRunner = { | |
run(testsRoot: string, reportTestResults: (error: Error, failures?: number) => void): void { | |
const projectRootPath = path.join(process.cwd(), '../..'); | |
const config = path.join(projectRootPath, 'jest.e2e.config.js'); | |
runCLI({ config } as any, [projectRootPath]) | |
.then(jestCliCallResult => { |
NewerOlder