Skip to content

Instantly share code, notes, and snippets.

View joe-oli's full-sized avatar
💭
what the flock? no status to report, i am not a facebook junkie.

joe-oli

💭
what the flock? no status to report, i am not a facebook junkie.
View GitHub Profile
@joe-oli
joe-oli / WPF.Demo.cs
Created July 14, 2023 04:55
WPF Demo Code
var dialog = new FolderBrowserDialog();
dialog.ShowDialog();
folderpathTB.Text = dialog.SelectedPath;
@joe-oli
joe-oli / recover_sa_pwd
Created May 7, 2023 11:30
Recover SQL Server 'sa' password
#1 Change the DB to single-user mode;
e.g. in SQL Configuration Manager, SQL Server services / <Your Server> / Properties / Startup Parameters
-f (Add, Apply)
RESTART (or stop, start)
#2
C:\Users\Administrator>SQLCMD -H $localhost
1> CREATE LOGIN newSA WITH PASSWORD = 'Pass@123'
2> go
1> ALTER SERVER ROLE sysadmin ADD MEMBER newSA
@joe-oli
joe-oli / Git-Notes.txt
Last active April 8, 2025 03:51
Git notes
List ALL branches
>git branch
LIST branches by wildcard
>git branch --list "122160*"
======================
CLONE A SINGLE BRANCH
======================
@joe-oli
joe-oli / GetNextSeqNbr.sql
Created December 7, 2022 11:56
Get Next Sequence Number
declare @result int
SET @result = (NEXT VALUE FOR dbo.auto_seq)
select @result
@joe-oli
joe-oli / AppInsights-notes.txt
Last active November 17, 2022 07:01
Application Insights Notes
https://learn.microsoft.com/en-us/azure/azure-monitor/app/ilogger
This helped me REDIRECT on Auth Failed!
https://github.com/dotnet/aspnetcore/issues/22596
OnAuthenticationFailed = context =>
{
context.Response.Redirect("/Error");
context.HandleResponse(); // Suppress the exception
return Task.CompletedTask;
},
@joe-oli
joe-oli / Entity-Framework-DOTNETCORE-notes.txt
Last active April 8, 2025 04:24
Entity-Framework with DOTNETCORE Scaffolding
I am annoyed as fck there is no point-and-click UI to do this;
Hence these notes as a reminder;
FIRST INSTALL via NuGet in YOUR project (NB: you may have multiple projects in the solution!)
a) 'Microsoft.EntityFrameworkCore';
b) 'Microsoft.EntityFrameworkCore.SqlServer'; choose the PROVIDER you want to use in the Scaffold-DbContext command.
c) 'Microsoft.EntityFrameworkCore.Tools'; this is so you can 'scaffold', i.e. generate code automatically; only fools will do the hard-work of writing by hand!
--
Above uses Visual Studio UI;
@joe-oli
joe-oli / SQLite-notes.txt
Created September 20, 2022 04:24
SQLite notes
Chrome Browser's SQLite location:
C:\Users\<user-name>\AppData\Local\Google\Chrome\User Data\Default\databases
@joe-oli
joe-oli / Javascript-tips.js
Last active September 10, 2022 04:50
Javascript tips
//#1. for . . . in
//By looping through the keys, you can get the value using object[key]
const object = {
name: "Cindi",
language:"js"
}
for(const key in object){
const value = object[key]
@joe-oli
joe-oli / MinimalAPIs.md
Created September 1, 2022 20:27 — forked from davidfowl/MinimalAPIs.md
Minimal APIs at a glance
@joe-oli
joe-oli / js-object-iteration.md
Created August 6, 2022 16:18 — forked from butterybread/js-object-iteration.md
How to iterate over object properties

Iterating over object properties

var foo = {bar: 'test'};

Object.keys(foo).forEach( function(key) {
    // property name
    console.log(key);
    // property value
    console.log(foo[key]);
});