Skip to content

Instantly share code, notes, and snippets.

# https://github.com/jimhall/TestBlog4/blob/e45e5d5bc16f7052110121d4a4d156092bc84973/scripts/test.py#L72-L83
# Simple logic if there are no new dirs to create
# https://stackoverflow.com/questions/29064227/how-can-i-test-to-see-if-a-defaultdictset-is-empty-in-python
create_dirs = missing_dirs(typedir)
if not create_dirs:
# Preferred way to exit:
# https://stackoverflow.com/questions/73663/how-to-terminate-a-python-script
print('No new ' + typedir + ' directories to create')
sys.exit()
@jimhall
jimhall / post.html
Last active May 15, 2020 13:31
jimhall.github.io _layouts/post.html
---
layout: default
---
<small>{{ page.date | date: "%-d %B %Y" }}</small>
<h1>{{ page.title }}</h1>
<p class="view">by {{ page.author | default: site.author }}</p>
{{content}}
@jimhall
jimhall / index.md
Last active July 2, 2020 20:25
jimhall.github.io custom index.md for the hacker theme
{% raw %}
---
layout: default
title: Welcome to my blog
---

<!-- Begin code @ index.md -->

# Welcome to my blog
import requests
import json
config_filename = "login.json"
host = "balder.norsestuff.com"
radport = "6788"
radurl = "https://" + host + ":" + radport
authrestapipath = "/api/authentication/1.0/Session"
try: