Skip to content

Instantly share code, notes, and snippets.

View maxime1992's full-sized avatar

Maxime maxime1992

View GitHub Profile
@cvan
cvan / commands.js
Last active September 2, 2025 20:26
cypress disable basic css transitions + animations
// Custom Cypress No-Motion helper
//
// To reduce flakiness in Cypress tests caused by motion,
// force disable all CSS transitions and animations.
//
// revised: 2023-03-15
// credits: @ypresto
function disableMotion(win) {
const injectedStyleEl = win.document.getElementById('__cy_disable_motion__');
@messified
messified / vscode_reduce_cpu_usage.md
Created October 30, 2019 18:15
VSCode Reduce CPU Usage

VSCode Reduce CPU Usage

Update your settings.json with the code below, then restart vscode:

{
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
 "**/.hg": true,
@LayZeeDK
LayZeeDK / angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Last active November 12, 2025 17:59
Angular CLI, Angular, Node.js, TypeScript, and RxJS version compatibility matrix. Officially part of the Angular documentation as of 2023-04-19 https://angular.dev/reference/versions
Angular CLI version Angular version Node.js version TypeScript version RxJS version
~16.0.0 ~16.0.0 ^16.13.0 || ^18.10.0 >=4.9.5 <5.1.0 ^6.5.5 || ^7.4.0
~15.2.0 ~15.2.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.1.0 ~15.1.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.0.5 ~15.0.4 ^14.20.0 || ^16.13.0 || ^18.10.0 ~4.8.4 ^6.5.5 || ^7.4.0
~14.3.0 ~14.3.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.2.0 ~14.2.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.1.3 ~14.1.3 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~14.0.7 ~14.0.7 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~13.3.0 ~13.3.0 ^12.20.2 || ^14.15.0 || ^16.10.0 >=4.4.4 <4.7.0 ^6.5.5 || ^7.4.0
@telenieko
telenieko / a_enable_wireless.sh
Created March 5, 2018 16:57
Sample files to enable wireless on Debian initramfs
#!/bin/sh
# this goes into /etc/initramfs-tools/scripts/init-premount/a_enable_wireless
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
@Allov
Allov / Dutch.md
Last active October 21, 2025 17:41
Règles du jeu Dutch

Dutch

Dutch

Le Dutch est un jeu de cartes qui se joue avec un paquet de cartes standards (sans les jokers). Il est recommandé d’utiliser deux paquets (104 cartes au total) pour des parties plus dynamiques.

  • Nombre de joueurs : 2 à 10
  • Durée moyenne d’une partie : environ 30 minutes

@michaelbromley
michaelbromley / create-mock.ts
Last active July 9, 2024 04:24
Automatic component mocking in Angular
import {Component, EventEmitter, Type} from '@angular/core';
type MetadataName = 'Input' | 'Output';
interface PropDecoratorFactory {
ngMetadataName: MetadataName;
bindingPropertyName: string | undefined;
}
interface PropMetadata { [key: string]: PropDecoratorFactory[]; }
import { EntityAdapter, EntityState } from '@ngrx/entity';
import { ActionReducer } from '@ngrx/store';
import { CommandReducer, ReducerCommand } from 'ngrx-command-reducer';
import { BaseAction, StaticAction } from './base.actions';
type PayloadActionFunction<S, P> = (p: P, s: S) => S;
type PayloadlessActionFunction<S> = (s: S) => S;
export type EntityFunction<S, P> = PayloadActionFunction<S, P> | PayloadlessActionFunction<S>;
export class EntityCommandReducer<Entity, State extends EntityState<Entity>, Action extends BaseAction> {

[Know about it][Understanding][Clear understanding]

NOVICE

CONCEPTS

  • xxx Immutable Data
  • xxx Second-Order Functions
  • xxx Constructing & Destructuring
  • xxx Function Composition
  • xxx First-Class Functions & Lambdas
@Injectable()
export class NgrxStoreService {
ondestroy$: Observable<void> = new Subject<void>();
constructor(protected store: Store<State>, protected changeDetector: ChangeDetectorRef) { }
select<R>(mapFunc: (state: State) => R): Observable<R> {
return this.store.select(mapFunc).pipe(
takeUntil(this.ondestroy$),

@ngrx/store v3

Problems:

  • Users want to compose reducer tree across modules
  • Idea of a single reducer function makes it difficult for the library to dynamically augment the shape of the state tree
  • Turning control over to the library to build the root reducer limits the use of meta-reducers
  • Feature modules may inadvertently collide with the state of the root module
  • Library authors may want to leverage @ngrx/store in their projects and provide an easy way