Skip to content

Instantly share code, notes, and snippets.

View estellepicq's full-sized avatar

Estelle Picq estellepicq

View GitHub Profile
@estellepicq
estellepicq / repl-playground-intructions.md
Last active December 11, 2022 07:16
JS playground - REPL configuration

Use repl as js playground with preloaded rxjs

Introduction

Where do you go when you need to quickly test out some JavaScript code? Using the Node REPL pre-configured with your favourite npm packages like RxJS is a fantastic way to quickly test things without disturbing your workflow.

Configuration

  1. Install rxjs and repl globally:
@estellepicq
estellepicq / d3-chart-bar.component.ts
Created June 19, 2022 07:08
d3.js time series chart - Angular
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import * as d3 from 'd3-selection';
import * as d3Scale from 'd3-scale';
import * as d3Shape from 'd3-shape';
import * as d3Array from 'd3-array';
import * as d3Axis from 'd3-axis';
interface Frequency {
letter: string;
frequency: number;
@estellepicq
estellepicq / observable-destroy.component.ts
Last active December 2, 2021 20:23
Generic unsubscriber for angular components
import { ReplaySubject } from 'rxjs';
import { OnDestroy, Component } from '@angular/core';
@Component({
template: '',
})
export class ObservableDestroyComponent implements OnDestroy {
protected destroyed$: ReplaySubject<void> = new ReplaySubject(1);
ngOnDestroy(): void {
@estellepicq
estellepicq / .eslintrc
Created July 18, 2021 13:41
.eslintrc file
{
"env": {
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},