Skip to content

Instantly share code, notes, and snippets.

View carloswm85's full-sized avatar
🎯
Compiling...

Carlos W. Mercado carloswm85

🎯
Compiling...
View GitHub Profile
@carloswm85
carloswm85 / GetTrackerPaginatedList.cs
Last active October 25, 2024 16:31
Datatables implementation, backend only.
/// <summary>
/// Retrieves a paginated list of trackers for a given request, supporting sorting, searching, and pagination.
/// Returns an object tailored for listing, <see cref="ListedTrackerDto"/>.
/// This method may be used with frontend calls compatible with DataTables.
/// </summary>
/// <param name="requestId">The ID of the specific request for which trackers are being retrieved.</param>
/// <returns>A JSON object containing paginated tracker data, total records, and any error messages if an exception occurs.</returns>
[HttpPost]
public virtual ActionResult GetTrackerPaginatedList(int requestId)
{
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
KLINE_CRYPTOS,
KLINE_CRYPTOS_BTC,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
KLINE_CRYPTOS_QUICK,
} from '../../../../../data/assets.data';
import { LoggingService } from '../logging/logging.service';
@carloswm85
carloswm85 / README.md
Created August 24, 2024 01:18
VSCode Debugger Configuration - Single project - Angular 17 SPA, with Node 20, nodemon, Express 4.19; with Edge Browser and Microsoft Edge Tools

Comments

  • Project date: 8/23/24
  • Commets generated using ChatGPT 4
  • Please, provide any suggestions you may find suitable.
  • Not all tasks from tasks.json are used.

Relevant Folder Structure

image

// Get dependency: `ng add @angular/material`
// Save to `src/app/material/material.module.ts`
// June 2024
import { NgModule } from '@angular/core';
/* ================================ MATERIAL ================================ */
// Importing Angular Material modules individually
// Each import provides a specific UI component from Angular Material
#!/bin/bash
# I wrote a shell script that takes a project name and then configures an Angular project with a prefix and all my preferences,
# which include eslint, prettier, and the Airbnb styles guide for Angular using pnpm (instead of npm).
#
# Download it to the parent directory where you want to create a new project ( I have them all in a directory called wdd430)
# and then make it executable with this command.
#
# chmod +x create-angular-project.sh
#
/** 1 */
// Inside build method, in form widget
void toggleDropdownEnabled(bool val) {
ref
.read(providerTrackerDrowndownIndustrialDegree.notifier)
.update((state) => val);
}
/** 2 */
// Inside form

Linting (ESLint) and Formatting (Prettier) in Angular

Term Tool Explanation Use Docs
πŸ”¦ Linter ESLint - Runs a set of discrete rules
- Slower
- Explicit logic for edge cases
Code quality (bug catching) πŸ“‘
🧹 Formatter Prettier - Reformats in one pass
- Faster
- Can't find and fix bugs
Code Formatting πŸ“‘
  • eslintconfigprettier -> Prettier -> Lint

Linters have two categories of rules: