Skip to content

Instantly share code, notes, and snippets.

View abonello's full-sized avatar

Anthony Bonello abonello

View GitHub Profile
@abonello
abonello / NodeServer.js
Last active March 20, 2026 09:08
const http = require('http')
const fs = require('fs')
const port = 3000
const server = http.createServer(function(req, res) {
//res.write('Hello World')
res.writeHead(200, { 'Content-Type': 'text/html' })
fs.readFile('index.html', function(error, data) {
if (error) {
@abonello
abonello / 00 Linq-Exercises.md
Last active March 17, 2026 11:00
Linq exercises I did in .NetFiddle

Linq exercises

I did these Linq Exercises in .NetFiddle and thought to have them here for easy access.


USE [SalesDB]
GO

/****** Object:  Table [dbo].[Orders]    Script Date: 15/03/2026 11:24:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
@abonello
abonello / Example_App_with_Endpoints.md
Last active March 17, 2026 17:45
Example Program.cs

Program.cs including:

  • EF Core DbContext
  • Seed data
  • CORS setup for your React dev server
  • Minimal API endpoints (CRUD for Customers)

using Microsoft.EntityFrameworkCore;
using MiniFullStackApi.Models;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more abo ut configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
@abonello
abonello / ASP_Net-scaffold.md
Last active March 17, 2026 17:47
Scaffold an ASP.Net project

Perfect! Now that your database is ready with Customers and Orders, we can move to the backend setup. Since this is a mini full-stack practice project, I recommend using ASP.NET Core Web API instead of a console app. This will mimic a real interview scenario more closely:


Step 1 – Create the ASP.NET Core Web API project

  1. Open Visual Studio (or VSCode with C# extension + .NET SDK installed).
  2. New Project → ASP.NET Core Web API
  3. Project name: MiniFullStackApi
  4. .NET version: latest LTS (for now, 7.0 or 8.0)
@abonello
abonello / Creating simple database.md
Last active March 17, 2026 17:47
Simple database

You’re on the right track — let’s clarify these points.


1️⃣ Customer Table: Identity Column

Yes, setting Id as Identity is correct. That means SQL Server will automatically generate unique IDs when you insert new customers.

USE MyFullStackDB;  -- replace with your database name
@abonello
abonello / TaskCRUDConsoleApp.cs
Last active March 14, 2026 16:50
Fundamentals of Crud in .net
using Microsoft.Data.SqlClient;
class Program
{
private static string connectionString = "Server=(localdb)\\mssqllocaldb;Database=LinqPracticeDB;Trusted_Connection=True;";
static void Main()
{
Console.WriteLine("Current Tasks:");
ShowTasks();
@abonello
abonello / LINQ-JS_Cheatsheet.md
Last active March 14, 2026 16:42
Simple explanation of basic LINQ

LINQ ↔ JavaScript Cheat Sheet

Language Integrated Query

Purpose: Translate LINQ operations to familiar JavaScript array methods. Think: LINQ = functional operations on collections (filter, map, reduce, sort, group, etc.)


Basic Operations

@abonello
abonello / DatePicker.js
Last active December 30, 2021 21:38 — forked from stevensacks/DatePicker.js
React Bulma DatePicker
import {addDays, format, isAfter, isBefore, startOfDay} from 'date-fns';
import React, {Component, Fragment} from 'react';
import classes from 'classnames';
import DatePickerDialog from './DatePickerDialog';
import Dialog from 'components/Dialog';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {getDisabled} from '../../../utils/component';
import PropTypes from 'prop-types';
import './index.css';