Skip to content

Instantly share code, notes, and snippets.

View nisests's full-sized avatar
🎯
Focusing

nisests

🎯
Focusing
View GitHub Profile
@nisests
nisests / gitlab-markdown-toc.js
Created January 9, 2017 03:59 — forked from gotofritz/gitlab-markdown-toc.js
creates a gitlab markdown table of contents for a README.md page
// quick and dirty snippet to creates a gitlab markdown table of contents for a README.md page
// preview gitlab page and paste in browser console
var str = "";
$('.file-content')
.find('h1, h2, h3, h4, h5, h6, h7')
.each((i, node) => {
// node.tagName is H1 H2...
let indent = Number(node.tagName[1]) - 1;
// markdown mested lists are
// - xxx
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
__author__ = 'Nisests'
import requests
from bs4 import BeautifulSoup
login_url = 'https://www.packtpub.com/'
accout_url = 'https://www.packtpub.com/account'