Skip to content

Instantly share code, notes, and snippets.

View ThibaultJanBeyer's full-sized avatar
🤖
Beedo…boop…bop…beeda…beep…boop…lop…bleeda…bee…bop…bleeda…booop…bopp

Thibault Jan Beyer ThibaultJanBeyer

🤖
Beedo…boop…bop…beeda…beep…boop…lop…bleeda…bee…bop…bleeda…booop…bopp
View GitHub Profile

pdfmake

Use in node.js

The module on npm exposes the pdfmake Printer, which the docs themselves do not cover. Using it is pretty simple though.

var path = require('path');
var Printer = require('pdfmake');
@JJediny
JJediny / gist:a466eed62cee30ad45e2
Created October 5, 2015 20:42
Jekyll Liquid Cheatsheet

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
@vikynandha-zz
vikynandha-zz / isDomElement.js
Last active August 30, 2017 08:38
Check if given object is a DOM element
function isElement(obj) {
try {
//Using W3 DOM2 (works for FF, Opera and Chrom)
return obj instanceof HTMLElement;
}
catch(e){
//Browsers not supporting W3 DOM2 don't have HTMLElement and
//an exception is thrown and we end up here. Testing some
//properties that all elements have. (works on IE7)
return (typeof obj==="object") &&
@conorbuck
conorbuck / angle-between-points.js
Created May 5, 2012 22:51
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};