Skip to content

Instantly share code, notes, and snippets.

View Saabbir's full-sized avatar

Saabbir Hossain Saabbir

View GitHub Profile
@Saabbir
Saabbir / hyper.js
Created November 15, 2023 20:22 — forked from coco-napky/hyper.js
Hyper config for git bash in Windows
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',

How to extract vector graphics (SVG images) from a PDF file

What we need to do:

  1. Enable WSL on Windows 10.
  2. Install Ubuntu (latest version) on WSL from the Windows Store.
  3. Install poppler-utils Command-line tool on WSL.
  4. Convert PDF file to an SVG file using pdftocairo tool, contained into poppler-utils.
  5. Use Inkspace to ungroup, copy, paste the desired vector graphic to a new SVG file.
  6. Use Illustrator to export that graphic as an SVG image.

How to fix "ReferenceError: primordials is not defined" error in NodeJS

Here's what you need to do:

Step 1

In the same directory where you have package.json create an npm-shrinkwrap.json file with the following contents:

{

Keybase proof

I hereby claim:

  • I am saabbir on github.
  • I am saabbir (https://keybase.io/saabbir) on keybase.
  • I have a public key ASCjaucQKEWUK2Adxv_Qzoadsv9jFkQHQizulYj8twQD4Qo

To claim this, I am signing this object:

@Saabbir
Saabbir / get-siblings.js
Created August 4, 2019 05:22
A short function to get all siblings of an element.
/**
* Get siblings of an element
* @param {Element} elem
* @return {Array}
*/
function getSiblings(elem) {
return [...elem.parentNode.children].filter(item => item !== elem);
}