Skip to content

Instantly share code, notes, and snippets.

$ node
> const markdownIt = require('markdown-it')
undefined
> const markdownItTocAndAnchor = require('markdown-it-toc-and-anchor')
undefined
> markdownIt().use(markdownItTocAndAnchor.default).render('## Real heading\n\n##\n\nEmpty heading above')
TypeError: Cannot read property 'type' of undefined
at Array.<anonymous> (/node_modules/markdown-it-toc-and-anchor/dist/index.js:55:53)
at Core.process (/node_modules/markdown-it/lib/parser_core.js:51:13)
at MarkdownIt.parse (/node_modules/markdown-it/lib/index.js:523:13)
a 7 2 4 0
a 4 0 5 2
a 4 8 5 2
a 9 3 1 8
a 7 2 9 3
a 5 3 7 0
b 4 0 7 2
b 9 3 7 2
b 7 2 4 6
b 4 2 9 8
@davidvandusen
davidvandusen / holidayobfuscation.js
Created December 22, 2017 20:52 — forked from krsnachandra/holidayobfuscation.js
Submission for LHL holiday obfuscation contest
function g() {
let a='Noel';
let b='Yuletide';
let c='Santa Claus';
let d='Rudolph';
let e='Snowflake';
let f='Occasion';
let g='North Pole';
let h='Christmas Tree';
let i='Joy';
BEGIN;
CREATE TABLE users (
id SERIAL PRIMARY KEY NOT NULL,
name VARCHAR(255) NOT NULL
);
CREATE TABLE connections (
id SERIAL PRIMARY KEY NOT NULL,
user_id_1 INTEGER NOT NULL,
@davidvandusen
davidvandusen / join_practice.txt
Created March 27, 2017 23:30
Simple example to show the difference between INNER, LEFT OUTER, RIGHT OUTER, and FULL OUTER joins in SQL
join_practice=# create table users (
join_practice(# id serial primary key,
join_practice(# username varchar(255)
join_practice(# );
CREATE TABLE
join_practice=# create table photos (
join_practice(# id serial primary key,
join_practice(# title varchar(255),
join_practice(# photographer_id integer
join_practice(# );

This script will start both the WebpackDevServer and the production API server at the same time.

Run the script from the project root folder with:

./start.sh

They can be stopped at the same time by pressing CTRL + C.

// Moment.js is a great library because of its shortcut methods for setting various properties on
// date-like Objects. These methods are used heavily in the function used to set the "sleep time"
// boundaries that bookend the calendar events correctly based on the time zone of the client.
const moment = require('moment');
// This function is the code entry point. Start following the code from here.
function main() {
// These calendar events should look similar to the ones that come back from the API. Their start
// and end dates are ISO Strings. These String values will have to be converted into Date Objects
// in order to be compared. They will also be converted into moment Objects in order to be
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Responsive Layout</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav id="navbar">Navigation</nav>
@davidvandusen
davidvandusen / ruby_classical_inheritance_review.md
Last active May 17, 2021 01:10
Ruby classical inheritance review

Classical Inheritance in Ruby

For programmers who are new to Object Oriented Programming, the ideas behind classical inheritance can take some getting used to. This article walks you through the syntax of defining class inheritance in Ruby with explanations of each OOP feature along the way. You will have created many inheriting classes and used them in Ruby code by the end of this exercise.

Create a new Ruby code file and copy the code examples into it as you go. Run the file with the provided driver code and read the output. Try writing your own driver code to try things out new concepts as they're introduced.

@davidvandusen
davidvandusen / links.txt
Last active April 8, 2018 02:21
Debugging breakout notes