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)
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <stdint.h> | |
#include <pcre.h> | |
using namespace std; | |
uint32_t cpufreq() | |
{ |
function random_text( $type = 'alnum', $length = 8 ) | |
{ | |
switch ( $type ) { | |
case 'alnum': | |
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; | |
case 'alpha': | |
$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; | |
case 'hexdec': |
<?php | |
$zoom = htmlspecialchars($_GET["zoom"]); | |
$x = htmlspecialchars($_GET["x"]); | |
$y = htmlspecialchars($_GET["y"]); | |
//explanation: https://gist.github.com/tmcw/4954720 | |
$y = pow(2, $zoom)-$y-1; | |
//source: https://github.com/timwaters/whoots/blob/master/whoots.rb |
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |
--[[ | |
Authorization logic | |
]]-- | |
function get_auth_params(where, method) | |
local params = {} | |
if where == "headers" then | |
params = ngx.req.get_headers() | |
elseif where == "basicauth" then |
#!/bin/bash | |
IPT="/sbin/iptables" | |
# Server IP | |
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')" | |
# Your DNS servers you use: cat /etc/resolv.conf | |
DNS_SERVER="8.8.4.4 8.8.8.8" | |
# Allow connections to this package servers |
### Admin email address | |
admin_email=admin@domain.com | |
### Setup the server to mirror | |
mirror=rsync://archive.ubuntu.com/ubuntu | |
### Log file path | |
log=/var/log/ubuntu | |
### Setup the local directory |
#!/bin/bash | |
# @author Adriano Rosa (http://adrianorosa.com) | |
# @date: 2014-05-13 09:43 | |
# | |
# Bash Script to create a new self-signed SSL Certificate | |
# At the end of creating a new Certificate this script will output a few lines | |
# to be copied and placed into NGINX site conf | |
# | |
# USAGE: this command will ask for the certificate name and number in days it will expire |