Skip to content

Instantly share code, notes, and snippets.

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@anuragvohraec
anuragvohraec / 2019-https-localhost.md
Created March 6, 2020 12:48 — forked from cecilemuller/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).

/*!
* JavaScript function to calculate the destination point given start point latitude / longitude (numeric degrees), bearing (numeric degrees) and distance (in m).
*
* Original scripts by Chris Veness
* Taken from http://movable-type.co.uk/scripts/latlong-vincenty-direct.html and optimized / cleaned up by Mathias Bynens <http://mathiasbynens.be/>
* Based on the Vincenty direct formula by T. Vincenty, “Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations”, Survey Review, vol XXII no 176, 1975 <http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf>
*/
function toRad(n) {
return n * Math.PI / 180;
};

azu/typescript1.5-es6module-npm at tsconfig-gulp

tsconfigが未対応なtsc1.4でもtsconfig.jsonをただの設定ファイル置き場として使う例。 filesGlobはatom-typescriptの独自拡張だけど

.
├── README.md
├── build
│   ├── bundle.js
@anuragvohraec
anuragvohraec / gulpfile.js
Last active October 12, 2023 22:15
Create a typescript + gulp + browserify project
"use strict";
const gulp = require('gulp');
const ts = require('gulp-typescript');
const browserify = require('browserify');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');
const gutil = require('gulp-util');
const uglify = require('gulp-uglify');
const sourcemaps = require('gulp-sourcemaps');
@anuragvohraec
anuragvohraec / typescript-web-components.md
Created April 3, 2020 11:22 — forked from aelbore/typescript-web-components.md
Step by Step creating web components in typescript using rollup

Getting Started

  • Install Dependencies
    npm init
    npm install --save-dev ts-node typescript tslib express @types/express
    

Create your web server

  • Create server.ts in root folder of your app.
@anuragvohraec
anuragvohraec / settings.json
Created April 8, 2020 02:31
VSCODE workspace
{
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true
},
"todo-tree.general.tags": [
"BUG",
"HACK",
@anuragvohraec
anuragvohraec / launch.json
Created April 9, 2020 11:41 — forked from cecilemuller/launch.json
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Node Inspector",
"type": "node",
"request": "launch",
"args": ["${workspaceRoot}/src/service.ts"],
"runtimeArgs": ["-r", "ts-node/register"],
"cwd": "${workspaceRoot}",
@anuragvohraec
anuragvohraec / CountryCodes.json
Created April 10, 2020 07:56 — forked from Goles/CountryCodes.json
Country and Dial or Phone codes in JSON format
[{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375","
@anuragvohraec
anuragvohraec / WebViewServer.kt
Created October 2, 2020 02:35 — forked from ErikHellman/WebViewServer.kt
This class is no longer needed now that Google provides WebViewAssetLoader (see https://developer.android.com/reference/kotlin/androidx/webkit/WebViewAssetLoader)
/*
MIT License
Copyright (c) 2019 Erik Hellman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is