Skip to content

Instantly share code, notes, and snippets.

View St1c's full-sized avatar

Bruno Gardlo St1c

  • Dataworkers
  • Zilina
View GitHub Profile

Linking a Provider (e.g., Google)

Since your frontend doesn't have the Firebase SDK, the linking process is managed by your NestJS backend. It's a standard OAuth flow where your backend orchestrates the steps.

The Flow:

  1. User Initiates Link: The logged-in user clicks "Link Google Account" in your Angular app.
  2. Backend Creates Auth URL: Your Angular app calls an endpoint on your NestJS API (e.g., GET /auth/google/link). Your backend uses a library like google-auth-library to generate a unique Google authentication URL. It's crucial to include a state parameter containing the user's session ID or a signed JWT to securely identify them upon callback.
  3. Frontend Redirects: The NestJS API sends this URL back to the Angular app, which then redirects the user to Google's sign-in page.
  4. User Authenticates: The user signs in with Google and approves the permissions.
@St1c
St1c / declarative_angular_forms_signals.md
Last active September 26, 2025 08:53
Declarative Angular Forms and Signals Connection

Of course. It's an excellent question that gets to the heart of modern Angular development. The key is to stop thinking about "two-way binding" and start thinking about a clean, predictable, unidirectional data flow.

Here is a comprehensive guide on how to declaratively interconnect Angular Reactive Forms with Signals, establishing a robust and maintainable pattern.


A Guide to Declaratively Connecting Signals and Angular Forms

The core challenge is that these are two powerful but distinct reactive systems:

@St1c
St1c / heikin-ashi-original-published-version.pine
Last active February 3, 2025 18:51
Pine script for Heikin Ashi reversal points
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © brunogardlo
//@version=6
indicator('Heikin Ashi reversal points', overlay = true)
HA_fast_interval = input.timeframe(title = 'HA Fast Interval', defval = '3D')
HA_slow_interval = input.timeframe(title = 'HA Slow Interval', defval = 'W')
smoothing_l = input.int(title = 'ALMA length', defval = 9, minval = 1)
alma_offset = input.float(title = 'ALMA Offset (smoothness/responsivness)', defval = 0.85, step = 0.05)
alma_sigma = input.int(title = 'ALMA Sigma', defval = 6, minval = 1)
@St1c
St1c / heikin-ashi-reversal-points.pine
Created February 3, 2025 18:43
Pine script for Heikin Ashi reversal points
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © brunogardlo
//@version=5
indicator('Heikin Ashi reversal points v2.0', overlay=false)
HA_fast_interval = input.timeframe(title='HA Fast Interval', defval='3D')
HA_slow_interval = input.timeframe(title='HA Slow Interval', defval='W')
hide_candle_values_fast = input(title='Hide fast candle open/close', defval=true)
hide_candle_values_slow = input(title='Hide slow candle open/close', defval=false)
hide_candle_extrems = input(title='Hide candle low/highs', defval=false)
@St1c
St1c / websocket-connection-service.ts
Created January 27, 2020 13:35
Websocket with socket.io-client library
import { Injectable } from '@angular/core';
import * as io from 'socket.io-client';
import { Observable } from 'rxjs';
import { environment } from '../../../environments/environment';
@Injectable({
providedIn: 'root'
})
const orig = '2019-12-06 23:06:25';
var d = new Date(orig.replace(' ', 'T') + 'Z');
var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', hour12: false, minute: '2-digit', second: '2-digit' };
var parsedDate = d.toLocaleString('en-US', options);
var date = parsedDate.split(', ')[0].split('/');
var time = parsedDate.split(', ')[1];
@St1c
St1c / mat-angular-dynamic-trees-example.html
Created March 8, 2019 08:06
Angular material trees example with dynamic data
<div style="text-align:center">
<h1>
Welcome to {{ title }}!
</h1>
<button mat-button
(click)="addFruit()">Add Fruit</button>
<button mat-button
(click)="addVegetable()">Add Vegetable</button>
<mat-tree [dataSource]="dataSource"
[treeControl]="treeControl">
@St1c
St1c / download.observable.js
Last active January 7, 2019 10:04
Download observable example
// download.service:
/**
* Create Download request
*
* @param size Size in Bytes, default 256kB
*/
download(size: number = 256 * 1024): any {
return Observable.create((observer) => {
let t;
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Scales Study Analysis"
]
},
{