Skip to content

Instantly share code, notes, and snippets.

View Dassderdie's full-sized avatar

Julian Schmidt Dassderdie

View GitHub Profile
import { Injectable } from '@angular/core';
import { SwUpdate } from '@angular/service-worker';
import { interval } from 'rxjs';
import { MatSnackBar } from '@angular/material';
@Injectable()
export class WorkerService {
constructor(public updates: SwUpdate, public snackBar: MatSnackBar) {
// If updates are enabled
@hediet
hediet / main.md
Last active March 1, 2025 04:07
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@alexeds
alexeds / move-stashes.md
Created September 5, 2012 18:00
Move your stashes from one repo to another

Move your stashes from one repo to another


This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.