Skip to content

Instantly share code, notes, and snippets.

View AbhiAgarwal192's full-sized avatar

Abhi Agarwal AbhiAgarwal192

View GitHub Profile
@AbhiAgarwal192
AbhiAgarwal192 / cross-tab-storage.ts
Created July 22, 2021 11:18 — forked from werthdavid/cross-tab-storage.ts
Special Storage-Implementation that uses sessionStorage (like the default of the OAuth-library) but also sets a marker in localStorage so that other Browser-Tabs get notified when the user on this Tab logs out.
/**
* Special Storage-Implementation that uses sessionStorage (like the default of the
* OAuth-library) but also sets a marker in localStorage so that other Browser-Tabs
* get notified when the user on this Tab logs out.
*/
export class CrossTabStorage extends OAuthStorage {
readonly MARKER_KEY = "LOGGED_IN";
constructor() {
@AbhiAgarwal192
AbhiAgarwal192 / mlnet-recommender2-load.cs
Last active July 4, 2019 15:53 — forked from mdfarragher/mlnet-recommender2-load.cs
This code is part of a Medium article.
/// <summary>
/// The main program class.
/// </summary>
class Program
{
// filename for dataset
private static string dataPath = Path.Combine(Environment.CurrentDirectory, "amazon0302.txt");
/// <summary>
/// The main entry point of the program.