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 / 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 July 22, 2023 16:18
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.Tools'; choose same Framework version that your project will target;
b) 'Microsoft.EntityFrameworkCore.SqlServer'; choose the PROVIDER you want to use in the Scaffold-DbContext command.
++++++++
0) Open the (Nuget) package manager console: Tools /NuGet PM / PM Console
1) **EXAMPLE**: (all on one line)
@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]);
});
@joe-oli
joe-oli / gist:9f110090d682353d3013ab31fa417dc3
Created July 3, 2022 09:26 — forked from eviltester/gist:7beef92896fdd8b638656f996fac38c0
Convert videos into subtitled sections using ffmpeg
# Create a new caption file
~~~~~~~~
ffmpeg -i captions.srt captions.ass
~~~~~~~~
# Add subtitles to main video without changing it
~~~~~~~~
ffmpeg -i video.mp4 -vf "subtitles=captions.ass:force_style='OutlineColour=&H80000000,BorderStyle=4,Outline=1,Shadow=0,MarginV=20'" subtitled-video.mp4
@joe-oli
joe-oli / promises.js
Created December 31, 2021 06:27 — forked from santisbon/promises.js
Promises example based on Mozilla Developer Network documentation
/*jslint devel: true, browser: true, es5: true */
/*global Promise */
var promiseCount = 0;
function testPromise() {
'use strict';
promiseCount += 1;
var thisPromiseCount = promiseCount;
@joe-oli
joe-oli / XMLHttpRequestPromise.js
Created December 31, 2021 06:27 — forked from santisbon/XMLHttpRequestPromise.js
Shows the implementation of a method which uses a Promise to report the success or failure of an XMLHttpRequest. Based on Mozilla Developer Network documentation.
/*jslint devel: true, browser: true, es5: true */
/*global Promise */
// $http function is implemented in order to follow the standard Adapter pattern
function $http(url) {
'use strict';
var core = {
// Method that performs the ajax request
ajax : function (method, url, args) {