Skip to content

Instantly share code, notes, and snippets.

View ChathuraGH's full-sized avatar
☺️
coding

Chathura madusanka ChathuraGH

☺️
coding
View GitHub Profile
@ChathuraGH
ChathuraGH / bundle.js
Created April 25, 2025 19:17 — forked from jackgill/bundle.js
A node.js script to create a bundle containing an npm package, and all of its dependencies.
/*
* This script will download a package (and all of its dependencies) from the
* online NPM registry, then create a gzip'd tarball containing that package
* and all of its dependencies. This archive can then be copied to a machine
* without internet access and installed using npm.
*
* The idea is pretty simple:
* - npm install [package]
* - rewrite [package]/package.json to copy dependencies to bundleDependencies
* - npm pack [package]

npm version cheatsheet

npm uses Semantic Versioning

npm uses Semantic Versioning. Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards compatible manner, and
  3. PATCH version when you make backwards compatible bug fixes.
@ChathuraGH
ChathuraGH / pandoc.css
Created April 1, 2025 13:26 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@ChathuraGH
ChathuraGH / proposal.md
Created March 18, 2025 14:21 — forked from DevilsAutumn/proposal.md
"Allow moving a model between apps" -- proposal for Google Summer of Code 2023.

"Allow moving a model between apps" proposal for Google Summer of Code 2023.

Table of content

  1. Abstract
    • 1.1 Overview
    • 1.2 Goals
    • 1.3 Benefits
  2. The solution
  • 2.1 Modified CreateModel operation .
@ChathuraGH
ChathuraGH / README.md
Created October 17, 2024 06:40 — forked from davelandry/README.md
SVG Text Wrapping

Using d3plus.textwrap, SVG <text> elements can be broken into separate <tspan> lines, as HTML does with <div> elements. In this example, the first column shows normal wrapped text, the second column shows text that is resized to fill the available space, and the third column shows the default SVG behavior.

D3plus automatically detects if there is a <rect> or <circle> element placed directly before the <text> container element in DOM, and uses that element's shape and dimensions to wrap the text. If it can't find one, or that behavior needs to be overridden, they can manually be specified using .shape( ), .width( ), and .height( ).

Featured on D3plus.org

To create anchor links that jump down to different sections of a README (as in an interactive table of contents), first create a heading:
#Real Cool Heading

The anchor link for that heading is the lowercase heading name with dashes where there are spaces. You can always get the anchor name by visiting the README on Github.com and clicking on the anchor that appears when you hover to the left of the heading. Copy everything starting at the #:
#real-cool-heading

Wherever you want to link to your Real Cool Heading section, put your desired text in brackets, followed by the anchor link in parentheses:
[Go to Real Cool Heading section](#real-cool-heading)

@ChathuraGH
ChathuraGH / magiczoomplus-video-gallery.html
Created December 30, 2023 12:03 — forked from Magic-Toolbox/magiczoomplus-video-gallery.html
Magic Zoom Plus gallery combined with YouTube and Vimeo videos
@ChathuraGH
ChathuraGH / gist:2e1b2c9f02390b1f85a4cd26768d26b8
Created August 5, 2021 03:38 — forked from schacon/gist:1
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.