This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aaron-bond.better-comments | |
adrianwilczynski.add-reference | |
adrianwilczynski.asp-net-core-switcher | |
adrianwilczynski.blazor-snippet-pack | |
adrianwilczynski.namespace | |
adrianwilczynski.terminal-commands | |
adrianwilczynski.user-secrets | |
alexcvzz.vscode-sqlite | |
amodio.tsl-problem-matcher | |
blackmist.linkcheckmd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void UpdateInstructorCourses(int[] selectedCourses, Instructor instructorToUpdate) | |
{ | |
if (selectedCourses == null) | |
{ | |
instructorToUpdate.CourseAssignments = new List<CourseAssignment>(); | |
return; | |
} | |
var selectedCoursesHS = new HashSet<int>(selectedCourses); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int BinarySearch(IReadOnlyList<int> array, int target) | |
{ | |
// Initialize left and right pointers for the binary search | |
int left = 0; | |
int right = array.Count - 1; | |
// Continue the search until the left pointer exceeds the right pointer | |
while (left <= right) | |
{ | |
// Calculate the middle index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"httpsWatch": { | |
"commandName": "Executable", | |
"executablePath": "dotnet", | |
"workingDirectory": "$(ProjectDir)", | |
"hotReloadEnabled": true, | |
"commandLineArgs": "watch run", | |
"applicationUrl": "http://localhost:5082", | |
"environmentVariables": { | |
"ASPNETCORE_ENVIRONMENT": "Development" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"ConnectionStrings": { | |
"Postgresql": "Host=localhost;Port=5432;Database=mydatabase;Username=myusername;Password=mypassword;", | |
"MySQL": "Server=localhost;Port=3306;Database=mydatabase;User=myusername;Password=mypassword;", | |
"SqlServer": "Server=localhost,1433;Database=DB_NAME;User Id=SA;Password=PASS;TrustServerCertificate=True;", | |
"Sqlite": "Data Source=app.db" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PaginationModel<T> : PageModel { | |
public int PageIndex { get; set; } | |
public int PageLimit { get; set; } | |
public int TotalItems { get; set; } | |
public List<T> Items { get; set; } = new(); | |
public bool IsValidPage { get; set; } | |
public async Task LoadItemsAsync(IQueryable<T> source, int? page, int? limit) { | |
if (page < 1 || limit < 1) { | |
IsValidPage = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
const port = 3000; | |
// Middleware to parse JSON in the query parameters | |
app.use(bodyParser.json()); | |
app.get('/test', (req, res) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to display help information | |
show_help() { | |
echo "Usage:" | |
echo " $(basename "$0") [OPTIONS] FILE" | |
echo " pipeline_command | $(basename "$0") [OPTIONS]" | |
echo "Reads lines from a file based on the specified filter." | |
echo "" | |
echo "Options:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://quera.org/college/8939/chapter/32512/lesson/108911/ | |
-- Create a sample table | |
CREATE TABLE sample_table | |
( | |
id INT PRIMARY KEY AUTO_INCREMENT, | |
first_name VARCHAR(50), | |
last_name VARCHAR(50) | |
); |
OlderNewer