Skip to content

Instantly share code, notes, and snippets.

View another-guy's full-sized avatar
💻
01001000 01000101 01001100 01001100 01001111

Igor Soloydenko another-guy

💻
01001000 01000101 01001100 01001100 01001111
View GitHub Profile
@another-guy
another-guy / simple-js-queue.js
Created May 24, 2024 04:00
LeetCode: linked-list-based queue, more performant than default JS's array-based one
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;
@another-guy
another-guy / simple-js-stack.js
Created May 23, 2024 04:35
LeetCode: linked-list-based stack, more performant than default JS's array-based one
function createStack() {
let top = { next: undefined, value: undefined };
function isEmpty() { return top.next === undefined; }
function push(v) { top = { next: top, value: v }; }
function pop() {
if (isEmpty()) return undefined;
const { value } = top;
top = top.next;
return value;
}
@another-guy
another-guy / time.learn.cantrill.io.js
Created April 25, 2024 19:50
learn.cantrill.io - time
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
@another-guy
another-guy / diy-vocabulary.md
Created October 7, 2019 20:19
DIY Vocabulary

divot — лунка, пробой

Keybase proof

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:

@another-guy
another-guy / yoga-options.md
Last active May 16, 2019 20:09
Yoga Options Around Auburn WA

Yoga Options

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
@another-guy
another-guy / .bash_profile
Last active August 19, 2019 18:48
My Bash Profile
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 "
@another-guy
another-guy / improved-then-block.ts
Last active March 4, 2019 09:47
Improved then block
.then(jestCliCallResult => {
jestCliCallResult.results.testResults
.forEach(testResult => {
testResult.testResults
.filter(assertionResult => assertionResult.status === 'passed')
.forEach(({ ancestorTitles, title, status }) => {
console.info(` ● ${ancestorTitles} › ${title} (${status})`);
});
});
@another-guy
another-guy / jest-test-runner-working-code.ts
Created March 4, 2019 09:24
Jest Test runner working code
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 => {
@another-guy
another-guy / vscode.e2e.jest.config.js
Last active March 4, 2019 09:20
VS Code E2E Jest Config
module.exports = {
moduleFileExtensions: ['js'],
testMatch: ['<rootDir>/out/test/**/*.test.js'],
verbose: true,
};