Skip to content

Instantly share code, notes, and snippets.

View navix's full-sized avatar
❄️
Coding smart ;)

Oleksa Novyk navix

❄️
Coding smart ;)
View GitHub Profile
@navix
navix / README.md
Created March 7, 2026 11:17
Lelit Anita Group cleaning

Group cleaning. Follow these steps:

  1. Place the blind filter in the portafilter
  2. Add 1 tea spoon of detergent powder (3-5 grams) in the blind filter
  3. Insert the portafilter into the brewing group
  4. Switch the espresso switch on for about 10 seconds
  5. Stop the espresso brewing and wait for 10 seconds
  6. Without removing the portafilter, repeat this operation 5 times
  7. Remove the portafilter, switch the espresso switch on again and rinse the portafilter under the hot wa- ter that comes out of the group. Turn the switch off
  8. Clean the brew group and the brew gasket first with the brush and then with a damp cloth in order to
@navix
navix / set-input.ts
Created October 3, 2025 09:44
Set Angular signal input
import type {InputSignal} from '@angular/core';
import {SIGNAL, signalSetFn} from '@angular/core/primitives/signals';
export function setInput<T>(input: InputSignal<T>, value: T) {
const node = input[SIGNAL];
signalSetFn(node, value);
}
@navix
navix / firehose_sub.ts
Created May 18, 2024 05:19
Very basic bluesky firehost subscription
import {AtUriUtil} from '@@api/at/at-uri';
import {cborToLexRecord, readCar} from '@atproto/repo';
import {Subscription} from '@atproto/xrpc-server';
import {bskyAgent} from '~/at/bsky-agent';
import {db} from '~/core';
import {CID} from 'multiformats/cid';
const endpoint = 'wss://bsky.network';
interface RepoEvent {
@navix
navix / nl2br.pipe.ts
Created January 5, 2023 20:04
nl2br pipe
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({
name: 'nl2br',
standalone: true,
})
export class Nl2brPipe implements PipeTransform {
transform(text: string): string {
return Nl2brPipe.replace(text);
}
@navix
navix / NG_PRETTIER_SETUP.md
Last active November 27, 2025 05:42
My Prettier setup for Angular apps
$ npm i prettier prettier-plugin-css-order prettier-plugin-organize-attributes css-declaration-sorter -D

Create .prettierrc file:

{
  "printWidth": 100,
  "tabWidth": 2,
@navix
navix / local-storage.ts
Last active September 8, 2025 19:14
Angular LocalStorage/SessionStorage services. Universal (SSR) compatible.
import { Platform } from '@angular/cdk/platform';
import { Injectable } from '@angular/core';
import { MemoryStorage } from './memory-storage';
@Injectable({
providedIn: 'root',
})
export class LocalStorage implements Storage {
private readonly storage: Storage;
@navix
navix / text-to-speech.ts
Created July 17, 2020 16:58
google text-to-speech
import { existsSync, mkdirSync } from 'fs';
import { resolve } from 'path';
import { config } from '../config';
export async function processTextToSpeech(ssml: string, filename: string) {
// Check media dir
const dirPath = resolve(config.main.storePath);
if (!existsSync(dirPath)) {
mkdirSync(dirPath);
}
@navix
navix / README.md
Last active May 13, 2019 11:51
Bind ngModel controls to ngForm from parent component

Bind ngModel controls to ngForm from parent component

This allows you to split a template-driven form on components.

Create formProvider directive to proxy ngModel injector from parent to child:

import { Directive, SkipSelf, forwardRef } from '@angular/core';
import { ControlContainer, Form } from '@angular/forms';
@navix
navix / readme.md
Last active February 4, 2023 18:40
Typescript advanced built-in types
@navix
navix / readme.md
Created February 11, 2019 12:10
Add nodes just after a component (not inside) in Angular 7

Add nodes just after a component (not inside) in Angular 7

For example we have radio-input and want to create a custom view. But no elements allowed inside input element.

<label>
  <input type="radio" uiRadio ...>
  Option A
</label>