Skip to content

Instantly share code, notes, and snippets.

View narainsagar's full-sized avatar
👋
email me for projects/work!!

Narain S. narainsagar

👋
email me for projects/work!!
View GitHub Profile
@cou929
cou929 / detect-private-browsing.js
Last active May 1, 2024 21:07
Detect private browsing mode (InPrivate Browsing or Incognito).
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
@wpscholar
wpscholar / get-value.php
Last active October 14, 2021 21:05
Get a value from an object or an array. Allows the ability to fetch a nested value from a heterogeneous multidimensional collection using dot notation.
<?php
/**
* Get a value from an object or an array. Allows the ability to fetch a nested value from a
* heterogeneous multidimensional collection using dot notation.
*
* @param array|object $data
* @param string $key
* @param mixed $default
* @return mixed
@soarez
soarez / ca.md
Last active March 4, 2026 04:50
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

interface Collection {
push(value: number): void;
pop(): number;
peek(): number;
isEmpty(): boolean;
}
class Node {
value: number;
constructor(value: number) {
@narainsagar
narainsagar / mac-apps.md
Last active September 17, 2015 13:23 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@zerothabhishek
zerothabhishek / talk-topics.md
Last active February 7, 2020 21:17
Javascript talk topics
  • Javascript async/await
  • ES7 - whats new
  • ES6 module system
  • ES6 generators
  • Fundamentals of this
  • Webpack - whats new in v4
  • Webpack - alternatives like parcel
  • Webpack - tips and tricks
  • Vue-js introduction
@Pen-y-Fan
Pen-y-Fan / Test Driven Development (TDD) Learning Plan.md
Last active January 12, 2026 09:07
Test Driven Development (TDD)

Learning Plan for Test Driven Development (TDD)

These learning resources primarily focus on Test Driven Development (TDD).

  • There is an emphasis on learning using PHP, Laravel and PHPUnit.
  • All these resources are free (at the time of writing)