Skip to content

Instantly share code, notes, and snippets.

@8bitme
8bitme / root_logger_settings.py
Created April 24, 2018 20:07 — forked from st4lk/root_logger_settings.py
Python logging settings for root logger
"""
Settings for root logger.
Log messages will be printed to console and also to log file (rotated, with
specified size). All log messages from used libraries will be also handled.
Three approaches for defining logging settings are used:
1. using logging classes directly (py25+, py30+)
2. using fileConfig (py26+, py30+)
3. using dictConfig (py27+, py32+)
Choose any variant as you like, but keep in mind python versions, that
@8bitme
8bitme / ghost-to-gatsby.js
Last active May 4, 2018 16:59 — forked from gbabiars/ghost-to-gatsby.js
A script to migrate posts from Ghost's exported json to Gatsby
const fs = require('fs');
const path = require('path');
const moment = require('moment');
const json = require('./8bitzen.ghost.2018-04-28.json');
const post_tags = json.db[0].data.posts_tags;
const tags = json.db[0].data.tags;
function ensureDirectoryExistence(filePath) {
var dirname = path.dirname(filePath);