Skip to content

Instantly share code, notes, and snippets.

View aBrihoum's full-sized avatar

Abdjalil Brihoum aBrihoum

View GitHub Profile
@aBrihoum
aBrihoum / angular_ngfor.html
Created September 12, 2021 09:43
Angular fake/dummy array for ngFor
<div *ngFor="let i of [].constructor(10)">
<h1> Hi </h1>
</div>
@aBrihoum
aBrihoum / MylocalStorageExp.js
Created August 9, 2020 17:10
localStorage with expiration / timer / timeout - dynamically
/* If u wanna dynamically check if the timer is/has expired, without reloading, uncomment line : [4][5][15][28][31] */
/* var myInterval = setInterval(myTimer, 1000); // every 1sec re-execute myTimer() */
/* function myTimer() { */
var now = new Date().getTime();
var mins = 10 // 10mins
var plusXmins = now + mins * 60 * 1000
var getItem = localStorage.getItem("expireTime")
if (getItem == null) {