- Install and start Docker Desktop.
- Copy the scripts in this Gist into a folder named
C:\SelfHosted\BentoPDF.Launch-BentoPDF.ps1is the entrypoint to run BentoPDF.- It pulls the latest image of
bentopdf/bentopdf-simplefrom Docker Hub and launches a Docker container from it. - It can automatically update the image if it is older than 7 days and run a fresh Docker container.
- It pulls the latest image of
bentopdf-idle-monitor.ps1is a helper script called byLaunch-BentoPDF.ps1.- It monitors the Docker container running BentoPDF for any network activity such as browser tabs connecting over the container port. Idle Docker container will be stopped after a default timeout of 30 minutes.
- It will automatically exit if the Docker container running BentoPDF is stopped externally by some other method.
- Update Settings to allow executing Powershell scripts. Quick way is to right-click Windows Powershell to Run as administrator and t
DISCLAIMER:
These are my notes for quick reference and not meant to be an exhaustive VSCode + NeoVim cheatsheet. Refer to VSCode, NeoVim and vscode-neovim documentation for the latest details.
- Install NeoVim 0.10.0+ and VSCode.
- Install vscode-neovim plugin in VSCode.
- Add the following to NeoVim's
init.lua--- Bootstrap lazy.nvim
DISCLAIMER: These notes from 'The Rust Programming Language' book are my own and meant for my personal reference. They are not endorsed by the Rust Foundation. Visit https://www.rust-lang.org/ for the official material for learning Rust.
- Install Rust from https://rustup.rs/.
- Check installation with -
ORrustc --version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * In a calendar where multiple events can be scheduled over the same time window, print a list of all | |
| * conflicting time windows along with the event IDs that are conflicting. All times are in 24 hour format. | |
| * Example: | |
| * Input: | |
| * Event 1 : 2014-01-01 9:45 - 2014-01-01 10:30 | |
| * Event 2 : 2014-01-01 10:00 - 2014-01-01 10:30 | |
| * Event 3 : 2014-01-01 10:20 - 2014-01-01 10:45 | |
| * | |
| * Output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Print all paths from a given source to a destination - (http://www.geeksforgeeks.org/find-paths-given-source-destination/) | |
| * Given a directed graph, a source vertex ‘s’ and a destination vertex ‘d’, print all paths from given ‘s’ to ‘d’. | |
| * */ | |
| import java.util.*; | |
| public class AllPathsFromASource { | |
| static class Graph{ | |
| int V; | |
| Map<Integer, List<Integer>> adj; // Adjacency list | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Find all possible outcomes of a given expression (http://www.geeksforgeeks.org/find-all-possible-outcomes-of-a-given-expression/) | |
| * ================================================ | |
| * Given an arithmetic expression, find all possible outcomes of this expression. Different outcomes are evaluated by | |
| * putting brackets at different places. | |
| * NOTES: | |
| * 1. There will be no spaces in the input. | |
| * 2. Only operators '+','-', and '*' are allowed. | |
| * 3. Numbers can have multiple digits. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| LeetCode 57. Insert Interval | |
| Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). | |
| You may assume that the intervals were initially sorted according to their start times. | |
| Example 1: | |
| Given intervals [1,3],[6,9], insert and merge [2,5] in as [1,5],[6,9]. | |
| Example 2: | |
| Given [1,2],[3,5],[6,7],[8,10],[12,16], insert and merge [4,9] in as [1,2],[3,10],[12,16]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| LeetCode 130. Surrounded Regions | |
| Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. | |
| A region is captured by flipping all 'O's into 'X's in that surrounded region. | |
| For example, | |
| X X X X | |
| X O O X | |
| X X O X | |
| X O X X |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * | |
| LeetCode 200. Number of Islands | |
| Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. | |
| An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. | |
| You may assume all four edges of the grid are all surrounded by water. | |
| Example 1: | |
| 11110 | |
| 11010 | |
| 11000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * LeetCode 394. Decode String - (Problem Link - https://leetcode.com/contest/3/problems/decode-string/) | |
| * | |
| * Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string | |
| * inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer. | |
| * You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc. | |
| * Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat | |
| * numbers, k. For example, there won't be input like 3a or 2[4]. | |
| * | |
| * Examples: |
NewerOlder