Skip to content

Instantly share code, notes, and snippets.

@n8rzz
n8rzz / max-todos.test.ts
Last active October 23, 2021 21:34
max-todos.test.ts - with todos
describe('.max()', () => {
describe('when `valueOne` is equal to `valueTwo`', () => {
test.todo('should return `valueOne`');
});
describe('when `valueOne` is less than `valueTwo`', () => {
test.todo('should return `valueTwo`');
});
describe('when `valueOne` is greater than `valueTwo`', () => {
@n8rzz
n8rzz / max.ts
Created October 19, 2021 17:32
max.ts
const max = (valueOne: number, valueTwo: number): number => {
if (valueOne === valueTwo) {
return valueOne;
}
return valueOne < valueTwo ? valueOne : valueTwo;
};
@n8rzz
n8rzz / Student.collection.ts
Created October 18, 2021 05:01
Student.collection.ts
import { StudentModel } from "./Student.model";
export class StudentCollection {
private _items: StudentModel[] = [];
get length(): number {
return this._items.length;
}
public addItems(itemsToAdd: StudentModel[]): void {
@n8rzz
n8rzz / Student.model.ts
Created October 18, 2021 04:58
Student.model.ts
export class StudentModel {
public age: number = -1;
public familyName: string = "";
public givenName: string = "";
get fullName(): string {
return `${this.givenName} ${this.familyName}`;
}
constructor(age: number, familyName: string, givenName: string) {
@n8rzz
n8rzz / ui-experiement-in-action.tsx
Created October 17, 2021 16:29
ui-experiement-in-action.tsx
<UiExperiments
a={
<UiMainButton_V1
classes={{ root: classes.button }}
minWidth={90}
testId={`${props.testId}_go-to-start-button`}
TouchRippleProps={{ classes: { ripple: classes.buttonRipple } }}
onClick={props.snapStartHandler}
>
{localizationStore.translate('ShaperPage:start')}
@n8rzz
n8rzz / ui-button-with-switch.tsx
Last active October 23, 2021 15:27
ui-button-with-switch.tsx
<UiButton
isV1={true}
variant={UiButtonVariant.Solid}
>
This is a Solid Button!
</UiButton>
@n8rzz
n8rzz / ui-experiement-usage.tsx
Last active October 30, 2021 22:02
ui-experiement-usage.tsx
<UiExperiment
a={<p>Using Experiments is simple and Awesome!</p>}
b={<UiTypography component={'p'} size={'body'}>Using Experiments is simple and Awesome!</UiTypography>}
isExperiementActive={true}
/>
@n8rzz
n8rzz / ui-experiment.tsx
Last active October 30, 2021 23:02
ui-experiment.tsx
import React from 'react';
export enum ExperimentName {
a = 'a',
b = 'b',
}
export type Experiment = {
[key in ExperimentName]: React.ReactNode;
};
@n8rzz
n8rzz / SofleKeyboard---nacerous.kbd.json
Last active July 18, 2021 01:45 — forked from josefadamcik/SofleKeyboard.kbd.json
SofleKeyboard - nacerous
[
{
"name": "SofleKeyboard - nacerous",
"author": "Josef Adamcik",
"switchMount": "cherry"
},
[
{
"y": 0.2,
"x": 3,
@n8rzz
n8rzz / TOS-custom-or-modified-studies.md
Last active February 9, 2022 07:26
customized studies for use within TDAmeritrade's ThinkOrSwim trading platform

ATRLatest

#
# TD Ameritrade IP Company, Inc. (c) 2014-2018
#
# Uses basic most recent value from ATR study then 
# displays value in a colorized label
#
# Modified by Nate Geslin (teamtomkins23@gmail.com)