To create an anchor to a heading in github flavored markdown.
Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:
[create an anchor](#anchors-in-markdown)
| LINK_DETECTION_REGEX = /(([a-z]+:\/\/)?(([a-z0-9\-]+\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(\s+|$)/gi | |
| EMOJI_DIRECTORY = "/path/to/assets/emoji/20x20" | |
| # Handlebars is presumed, but you could swap out | |
| ESCAPE_EXPRESSION_FUNCTION = Handlebars.Utils.escapeExpression | |
| MARKSAFE_FUNCTION = (str) -> new Handlebars.SafeString(str) | |
| # Emoji unicode chars become images. |
| var mongoose = require('mongoose'); | |
| mongoose.connect('mongodb://localhost/test'); | |
| var db = mongoose.connection; | |
| db.on('error', function() { | |
| return console.error.bind(console, 'connection error: '); | |
| }); | |
| #!/usr/bin/env python | |
| # ping a list of host with threads for increase speed | |
| # use standard linux /bin/ping utility | |
| from threading import Thread | |
| import subprocess | |
| try: | |
| import queue | |
| except ImportError: | |
| import Queue as queue |
| # Make cgit generate link using absolute URL | |
| virtual-root=/cgit.cgi/ | |
| # Enable caching of up to 1000 output entriess | |
| cache-size=1000 | |
| # cache time to live | |
| cache-dynamic-ttl=5 | |
| cache-repo-ttl=5 |
| // the main app file | |
| import express from "express"; | |
| import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
| import authenticate from "./authentication"; // middleware for doing authentication | |
| import permit from "./authorization"; // middleware for checking if user's role is permitted to make request | |
| const app = express(), | |
| api = express.Router(); | |
| // first middleware will setup db connection |
| #!/bin/bash | |
| # Written and tested on CentOS 7 | |
| iptables -nvL |cut -f -9|column -t| sed 's/^Chain/\n&/g'|sed '/^Chain/ s/[ \t]\{1,\}/ /g'|sed '/^[0-9]/ s/[ \t]\{1,\}/ /10g' |
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # .see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If running non interactively, do nothing | |
| ######################################################## | |
| #|# Preamble # | |
| ######################################################## | |
| [ -z "$PS1" ] && return |
| docker run \ | |
| --name {{printf "%q" .Name}} \ | |
| {{- with .HostConfig}} | |
| {{- if .Privileged}} | |
| --privileged \ | |
| {{- end}} | |
| {{- if .AutoRemove}} | |
| --rm \ | |
| {{- end}} | |
| {{- if .Runtime}} |