Skip to content

Instantly share code, notes, and snippets.

@virendrakryadav
virendrakryadav / gist:c1c686c604c0ec1a1a58431cc8783298
Created March 5, 2024 16:57 — forked from donaldallen/gist:9557256
Handle Daylight Savings Time (DST) in Javascript.
var today = new Date();
Date.prototype.stdTimezoneOffset = function() {
var jan = new Date(this.getFullYear(), 0, 1);
var jul = new Date(this.getFullYear(), 6, 1);
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}
Date.prototype.dst = function() {
return this.getTimezoneOffset() < this.stdTimezoneOffset();
@virendrakryadav
virendrakryadav / README.md
Created October 16, 2023 06:43 — forked from piyushgarg-dev/README.md
Kafka Crash Course
@virendrakryadav
virendrakryadav / outline-server-setup.md
Created July 5, 2022 13:30 — forked from sanskritkm/outline-server-setup.md
How to setup an Outline VPN Server on Ubuntu 16.04

How to setup an Outline VPN Server on Ubuntu 16.04 Server

This guide will show you how to install Outline Server on an Ubuntu 16.04 Server and use Outline Manager.

Install Outline Manager

Outline Manager supports Windows, macOS and Linux.

Outline Manager for Windows

@virendrakryadav
virendrakryadav / Balsamiq Mockups 3.5.17
Created July 5, 2022 13:28 — forked from sanskritkm/Balsamiq Mockups 3.5.17
Balsamiq Mockups 3.5.17 for Desktop full license key (Tested) or Balsamiq Wireframes for Desktop
Balsamiq Wireframes for Desktop full license key free
This old name is Balsamiq Mockups now the company changing the name to Balsamiq Wireframes for Desktop insteed
HOW TO:
First download softwere here: https://balsamiq.com/wireframes/desktop/
Install and follow screen direction
Use below serial:
=====================================================================================
@virendrakryadav
virendrakryadav / 2019-https-localhost.md
Created July 5, 2022 13:28 — forked from sanskritkm/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@virendrakryadav
virendrakryadav / gist:2027932
Created March 13, 2012 09:57
//generates a random password which contains all letters (both uppercase and lowercase) and all numbers
//generates a random password which contains all letters (both uppercase and lowercase) and all numbers
function generatePassword($length) {
$password='';
for ($i=0;$i<=$length;$i++) {
$chr='';
switch (mt_rand(1,3)) {
case 1:
$chr=chr(mt_rand(48,57));
break;
case 2: