Skip to content

Instantly share code, notes, and snippets.

View sinedied's full-sized avatar

Yohan Lasorsa sinedied

View GitHub Profile
@sinedied
sinedied / multiple-ssh.md
Last active February 28, 2023 16:11
Setup multiple SSH keys for GitHub EMU accounts

Setup multiple SSH keys for GitHub EMU accounts

1. Create a new SSH key

We'll first generate a new SSH key, by running:

ssh-keygen -t rsa -b 4096 -C "my.email@microsoft.com"`
@sinedied
sinedied / exp.json
Created January 6, 2023 16:04
of export
{
"sessions": {
"869f7c938bf1dd95f95a0dc5b2d585f3": {
"id": "869f7c938bf1dd95f95a0dc5b2d585f3",
"tags": [
"Cloud & DevOps",
"Workshop"
],
"title": "Coder votre infrastructure avec votre langage préféré !",
"startTime": "2023-01-25T09:30+02:00",
@sinedied
sinedied / fastread.js
Last active June 5, 2022 15:29
Fast reading experimentation
// Usage: fastRead('Lorem ipsum dolor sit amet')
function fastRead(text, left = '<b>', right = '</b>') {
return text?.replace(/[A-Za-zÀ-ÖØ-öø-ÿ0-9]+/gm, (word) => {
const split = word.length > 3 ? Math.ceil(word.length / 2) : 1;
return left + word.substring(0, split) + right + word.substring(split);
});
}
@sinedied
sinedied / day8.js
Created December 8, 2020 10:06
advent of code day 8
const fs = require('fs');
const input = fs.readFileSync('input.txt', 'utf-8');
const prog = input.split('\n');
new Array(prog.length)
.fill('')
.map((_, i) => {
const variant = prog.slice();
const inst = prog[i];
const newInst = inst[0] === 'j' ? inst.replace('jmp', 'nop') : inst.replace('nop', 'jmp');
@sinedied
sinedied / po-cheatsheet.md
Last active April 10, 2020 19:15
Teenage Engineering PO Cheatsheet

All PO

  • Volume: BPM+1-16
  • Swing: BPM+Knob A
  • Chain patterns: hold PATTERN then 1-16 as you want
  • Copy pattern: WRITE+PATTERN then 1-16 for destination
  • Clear pattern: *+PATTERN
  • Record parameters (P-Lock): in live rec mode, hold WRITE + turn knob
  • Step copy: in write mode, hold a step for 1 sec
  • Step note/length: in write mode, hold step + Knob A/B
  • Retrigger: in write mode, hold a step + BPM to cycle modes
import { Inject, Injectable, InjectionToken, Injector, Optional } from '@angular/core';
import { HttpClient, HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { ErrorHandlerInterceptor } from './error-handler.interceptor';
import { CacheInterceptor } from './cache.interceptor';
// HttpClient is declared in a re-exported module, so we have to extend the original module to make it work properly
// (see https://github.com/Microsoft/TypeScript/issues/13897)
declare module '@angular/common/http/src/client' {
@sinedied
sinedied / introrx.md
Created January 31, 2017 09:13 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@sinedied
sinedied / ngrxintro.md
Created January 31, 2017 07:45 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@sinedied
sinedied / angular.md
Last active November 8, 2023 22:53
The Missing Introduction to Angular 2 and Modern Design Patterns

Introduction to Angular

Angular (aka Angular 2) is a new framework completely rewritten from the ground up, replacing the famous AngularJS framework (aka Angular 1.x).

More that just a framework, Angular should now be considered as a whole platform which comes with a complete set of tools, like its own CLI, debug utilities or performance tools.

Getting started

/**
* @license Copyright (c) 2012, toddb GoneOpen Limited.
* Available via the MIT or new BSD license.
* based on https://gist.github.com/966776 (mathieul) and forked to https://gist.github.com/1474205
*
* 23/07/13: - added automatic test scoping of callback function arguments.
* - renamed _requires alias to jrequire
*
* jasmine.requirejs() returns a function that will load the file(s) required
* and will wait until it's done before proceeding with running specs.