Skip to content

Instantly share code, notes, and snippets.

@amit08255
amit08255 / jiofi-video-stream.md
Created September 19, 2022 07:42
Streaming video through JioFi
  1. Login to http://jiofi.local.html
  2. Now go to WiFi Disk section and login to it.
  3. On the right side section where files are being displayed, right click -> This iframe -> Open iframe in new tab.
  4. It will open a URL like: http://jiofi.local.html/cgi-bin/en-jio-4/mSDCard.html
  5. Create a .html file with below code:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

  <head>
@amit08255
amit08255 / markdown-hierarchy-heading.md
Created October 2, 2022 12:28
Markdown to hierarchy based on heading
const getLines = (val:string) => val.split(/\r?\n/);

const getHeadingLevel = (val: string) => {
    const tokenizer = /(#{1,6})\s*(.+)(?:\n+|$)/gm;

    const token = tokenizer.exec(val);

    if (token && token[1]) {
 return token;
@amit08255
amit08255 / html-hierarchy-heading.md
Created October 2, 2022 12:30
HTML hierarchy based on heading
function nest_headings(headings) {
	/*
		Return an array of nested heading objects of the form:
		{
			heading: html element
			level: integer 1-6
			children: child headings
		}
	*/
@amit08255
amit08255 / vagrant-vmware-tech-preview-apple-m1-pro.md
Created October 8, 2022 04:26 — forked from sbailliez/vagrant-vmware-tech-preview-apple-m1-pro.md
Vagrant and VMWare Tech Preview on Apple M1 Pro

Vagrant and VMWare Tech Preview on Apple M1 Pro

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22

Created on: November 1, 2021 Updated on: September 17, 2022

Installing Rosetta

@amit08255
amit08255 / docker-cheatsheet.md
Created October 18, 2022 17:08
Docker CheatSheet

Docker CheatSheet

Connect to postgreSQL using terminal

Docker compose example with postgreSQL:

version: "3"
services:
 # Postgres
@amit08255
amit08255 / json-generator.md
Created November 18, 2022 12:21
JSON Generator Examples

These cheatsheet works for JSON-Generator

Using Custom Function For Final Data Result

[
  {
    data: [
      '{{repeat(15, 45)}}',
 {
@amit08255
amit08255 / guide.md
Created November 20, 2022 14:26 — forked from neoneye/guide.md
Install GraphicsMagick on AWS EC2 running Ubuntu Linux
@amit08255
amit08255 / rxjs.md
Last active November 24, 2022 17:49
RXJS Cheatsheet

RXJS CheatSheet

Basic Concept

The essential concepts in RxJS which solve async event management are:

  • Observable: represents the idea of an invokable collection of future values or events.
  • Observer: is a collection of callbacks that knows how to listen to values delivered by the Observable.
  • Subscription: represents the execution of an Observable, is primarily useful for cancelling the execution.
  • Operators: are pure functions that enable a functional programming style of dealing with collections with operations like map, filter, concat, reduce, etc.
@amit08255
amit08255 / pdf2png.js
Created December 7, 2022 17:08 — forked from grantmichaels/pdf2png.js
PDF to PNG with Node.js and GhostScript
var exec = require('child_process').exec;
var fs = require('fs');
var util = require('util');
var http = require('http');
var url = require('url');
var PDFDocument = require('pdfkit'); // http://pdfkit.org/
http.createServer(function (req, res) {
function interceptNetworkRequests(ee) {
const open = XMLHttpRequest.prototype.open;
const send = XMLHttpRequest.prototype.send;
const isRegularXHR = open.toString().indexOf('native code') !== -1;
// don't hijack if already hijacked - this will mess up with frameworks like Angular with zones
// we work if we load first there which we can.
if (isRegularXHR) {