Skip to content

Instantly share code, notes, and snippets.

View geistchevalier's full-sized avatar

geistchevalier

View GitHub Profile
@geistchevalier
geistchevalier / index.d.ts
Last active June 28, 2018 09:04
Typescript definitions / @types : examples for different kinds of functions
// !! DISCLAIMER !! I'm still a beginner at Typescript and only mediocre at javascript.
// If you see any sort of mistake please do feel free to comment.
// This gist was created because I was trying to figure out how to port out
// some old js codes to typescript and I had to deal with libraries with no @types files.
/*------------------------------------------*/
// BEFORE YOU START
// If you want to totally ignore with the whole typing thing for functions
// Just declare this in your Typescript file
declare var function_name_here: any; // if the function returns something
@geistchevalier
geistchevalier / bootstrap_modal_toggle_callback.html
Created June 28, 2018 09:20
Add some sort of a "callback" to the bootstrap modal open and close event to avoid the transparent grey / gray div staying due to the DOM getting destroyed before it is removed
<!-- Had a bootstrap modal that didn't close fully before the another modal is called -->
<!-- from googling around most people reccomended acting on the hidden events -->
<!-- but I only wanted it to work only when a specific function is called -->
<!-- EVENTS MAY DIFFER FROM VERSION TO VERSION -->
<!-- https://getbootstrap.com/docs/4.0/components/modal/#events -->
<!--
$("your jquery selector here").one('your choice of events', function(e) {
// Do something here
});
@geistchevalier
geistchevalier / Startup.cs
Created October 10, 2019 06:07
[Telerik Kendo UI][dotnet core 2.x] Grid not showing data
// I was getting an empty grid even though the POST request returned a [200] response
// and there was data in the response body when I checked the browser console.
//
// Turns out .NET Core MVC has a behavior of formatting anything that passes the Json() function to be camelCased.
// Telerik Kendo was probably looking for something like "response.Data" but the response gave "response.data", note the lowercase
// Go to your Startup.cs in your project and add the following to the MVC services
services.AddMvc()
.AddJsonOptions(option => option.SerializerSettings.ContractResolver = new DefaultContractResolver()); // Add JsonOptions
@geistchevalier
geistchevalier / remove bromium folder.ps1
Last active July 15, 2023 04:49
Simple script to remove ~BROMIUM folder left by HP security wolf, [RUN AT YOUR OWN RISK]
Get-ChildItem -Include ~BROMIUM -Recurse -Force | Remove-Item -Recurse -Force