Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / debug-events.js
Created August 18, 2022 12:28 — forked from alessioalex/debug-events.js
intercept *.addEventListener for debugging
// http://stackoverflow.com/questions/4787698/failure-to-override-elements-addeventlistener-in-firefox
(function() {
Error.stackTraceLimit = Infinity;
var _interfaces = Object.getOwnPropertyNames(window).filter(function(i) {
return /^HTML/.test(i);
}).map(function(i) {
return window[i];
});
@amit08255
amit08255 / intercept-function.js
Created August 18, 2022 10:29 — forked from tilmanschweitzer/intercept-function.js
Function to intercept functions calls even to nativ functions.
function interceptFunction (object, fnName, options) {
var noop = function () {};
var fnToWrap = object[fnName];
var before = options.before || noop;
var after = options.after || noop;
object[fnName] = function () {
before.apply(this, arguments);
var result = fnToWrap.apply(this, arguments);
after.apply(this, arguments);
@amit08255
amit08255 / cheatsheet.md
Last active June 20, 2023 17:15
DigitalOcean Cheatsheet

DigitalOcean Cheatsheet

Building Node.js Application

To build Node.js without interrupting run below command:

nohup yarn build &
@amit08255
amit08255 / rarreg.key
Created August 1, 2022 23:21 — forked from MuhammadSaim/rarreg.key
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@amit08255
amit08255 / axios-cache-interceptors.js
Created July 13, 2022 17:49 — forked from javisperez/interceptors.js
Axios interceptor for cache with js-cache
// Usually I use this in my app's config file, in case I need to disable all cache from the app
// Cache is from `js-cache`, something like `import Cache from 'js-cache';`
const cacheable = true,
cache = new Cache();
// On request, return the cached version, if any
axios.interceptors.request.use(request => {
// Only cache GET requests
if (request.method === 'get' && cacheable) {
@amit08255
amit08255 / README.md
Last active June 29, 2022 18:09
Chrome extension inject javascript

Chrome Extension Inject JavaScript to Website

Simple example to inject console panel to any website. It injects CSS and JavaScript to the website.

Example: Manifest.json

{
  "name": "Athena",
  "description": "Athena, a tool for improving communication between developers and testers.",