Skip to content

Instantly share code, notes, and snippets.

How to convert markdown to PDF:

This post reviews several methods for converting a Markdown (.md) formatted file to PDF, from UNIX or Linux machines.

Using Pandoc:

$ pandoc How_I_got_svg-resizer_working_on_Mac_OSX.md -s -o test1.pdf
##Some points to mention...
##
##The model knows nothing about the view or the controller.
##The view knows nothing about the controller or the model.
##The controller understands both the model and the view.
##
##The model uses observables, essentially when important data is changed,
##any interested listener gets notified through a callback mechanism.
##
##The following opens up two windows, one that reports how much money you
// runs in https://twigl.app/, geekest (300 es) mode
#define tex(i,j) texture(b,fract((FC.xy+vec2(i,j))/r))
#define tx(i,j) tex(i,j).a
#define isGround(v) (abs(v-.5)<.1)
#define isSand(v) (abs(v-1.)<.1)
#define fallL(i,j) (int(f)%2==0)
#define fallR(i,j) !fallL(i,j)
#define prio(i,j) fsnoise(uv+vec2(i,j)-t)
vec2 uv = FC.xy/r;
@waynejr2
waynejr2 / springer-free-maths-books.md
Created August 10, 2019 06:40 — forked from jnpaulson/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@waynejr2
waynejr2 / ultimate-ut-cheat-sheet.md
Created July 4, 2018 22:32 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@waynejr2
waynejr2 / DocumentViewerSpec.js
Created August 12, 2017 22:58 — forked from patkujawa-wf/DocumentViewerSpec.js
Jasmine 1.3 (with jasmine.async lib) example code
'use strict';
/**
https://github.com/derickbailey/jasmine.async
(MIT License)
Copyright ©2012 Muted Solutions, LLC. All Rights Reserved.
*/
var AsyncSpec = (function() {
'use strict';
@waynejr2
waynejr2 / gist:363cefdcf2b5ba5fd86f96a74dac6a12
Created July 6, 2017 22:55 — forked from jdavidw13/gist:2156565
A parser for DnD dice rolls, with support for min/max rolls.
//infix operator-precedence parser
//also supports a d operator - a dice roll
var parsePrecedence = (function () {
//we don't care about whitespace. well, most whitespace
var whitespace = {
' ' : true,
'\t' : true
};
@waynejr2
waynejr2 / kruskals.rb
Created November 28, 2016 18:55 — forked from jamis/kruskals.rb
An implementation of Kruskal's algorithm for generating mazes.
# --------------------------------------------------------------------
# An implementation of Kruskal's algorithm for generating mazes.
# Fairly expensive, memory-wise, as it requires memory proportional
# to the size of the entire maze, and it's not the fastest of the
# algorithms (what with all the set and edge management is has to
# do). Also, the mazes it generates tend to have a lot of very short
# dead-ends, giving the maze a kind of "spiky" look.
# --------------------------------------------------------------------
# NOTE: the display routine used in this script requires a terminal
# that supports ANSI escape sequences. Windows users, sorry. :(
@waynejr2
waynejr2 / dijkstra.js
Created December 4, 2015 01:17 — forked from bellbind/dijkstra.js
[javascript]dijkstra algorithm (with custom data structure)
// Dijkstra Algorithm Example
// - Using suite data structure make algorithm clearer
// compile graph data to vertices structure: {"label": Vertex, ...}
// - Graph: [{from: "label", to: "label". cost: number}, ...]
// - Vertex: {label: string, edges: [{dest: Vertex, cost: number}, ...]}
var compileVertices = function (graph) {
var vs = {};
graph.forEach(function (edge) {
if (!vs[edge.from]) vs[edge.from] = {label: edge.from, edges: []};
@waynejr2
waynejr2 / mersenne-twister.js
Created November 26, 2015 04:26 — forked from banksean/mersenne-twister.js
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();