Skip to content

Instantly share code, notes, and snippets.

View kuncevic's full-sized avatar
🎯
Focusing

Lex Kuncevič kuncevic

🎯
Focusing
View GitHub Profile
@kuncevic
kuncevic / reactive-services-1.ts
Last active September 6, 2020 10:00
Reactive Services with BehaviourSubject
export class CounterService {
private data$ = new BehaviorSubject<Counter>(initialState);
state$ = this.data$.asObservable();
constructor() {}
public setValue1(value1): void {
const currentData = this.data$.getValue();
this.data$.next({ ...currentData, value1: currentData.value1 + value1 });
}
export class ResetCounter {
public static type = '[Counter] Reset Count';
constructor() {}
}
export class UpdateValue1 {
public static type = '[Sum] Update Value1';
constructor(public readonly amount: number) {}
}
@kuncevic
kuncevic / landingpage.html
Created January 7, 2021 11:28 — forked from jasonalderman/landingpage.html
Simple, single-page, "coming soon" landing page template.
<!DOCTYPE html>
<html>
<head>
<!-- This is a template for a landing page!
✓ Fill in the things between the {{double braces}}, removing the {{ and }} in the process.
✓ Make a logo image for the <img> tag, and take note of its width and height.
✓ Make a sharing image for the OpenGraph/Facebook/Twitter <meta> tags (square, 1200x1200px).
✓ Tweak CSS as necessary.
✓ Rename this file to index.html and upload it and the two images to the web root directory on your server.
✓ Remove this comment when done. -->
@kuncevic
kuncevic / child.component.html
Created March 1, 2021 23:01
NGXS Data example.
<div class="wrapper">
<div class="title">
Child 👦
</div>
<div class="content">
<div class="action">
<button (click)="counter.updateValue2(-1)">-1</button>
<span class="value"> {{ counter.snapshot.value2 }}</span>
<button (click)="counter.updateValue2(1)">+1</button>
</div>
@kuncevic
kuncevic / ngconf-snippets-new.md
Created May 7, 2021 08:12 — forked from brandonroberts/ngconf-snippets-new.md
Component Router (New) snippets

Snippets for workshop

Step 1 - Home Route

<base href="/">

'@angular/router':                   { main: 'index.js', defaultExtension: 'js' },

import {ROUTER_PROVIDERS} from '@angular/router';
@kuncevic
kuncevic / figletpreview.sh
Created September 20, 2021 09:14 — forked from crahan/figletpreview.sh
Print out a preview of all installed Figlet fonts.
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "I need some text to print."
exit 1
fi
for i in `ls /usr/local/Cellar/figlet/2.2.5/share/figlet/fonts/*.flf`; do
echo -e "==== $(basename $i) ====\n"
figlet -f $i $1
name: Deploy Monorepo
on:
push:
path: projects/app1
branches: [master, staging]
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
steps: