Skip to content

Instantly share code, notes, and snippets.

View HoverBaum's full-sized avatar
🌳
 I like 🌳🌳🌳 

Hendrik HoverBaum

🌳
 I like 🌳🌳🌳 
View GitHub Profile
@HoverBaum
HoverBaum / popover-titles.css
Created November 6, 2023 13:16
Display inline titles inside popovers.
/* Display inline titles inside popovers */
.hover-popover .inline-title {
display: block;
}
/* Uncomment the below for inline titles inside inline embeds */
/*
.inline-embed .inline-title {
display: block;
}
@HoverBaum
HoverBaum / blog_feature.txt
Created March 17, 2023 20:43
Wildcard files for prompt experiment.
cyberdeck
glowing eyes
cyber implant
nanoblades
face tattoo
flashy
bald head
energy staff
cyber-syringes
#!/bin/bash
<< ////
The script creates 'licenses' under '$ANDROID_HOME' and creates a file which proves
that the SDK license was accepted by the user.
Please copy this to your own account/gist/server. Every time there's an updated license, update the file with the new
license hash.
Legally if you run this script (or your own version of it), it means YOU accepted the license - don't trust someone else.
The hashes below are supposed to be taken from $ANDROID_HOME/licenses/android-sdk-license on YOUR machine, after you
@HoverBaum
HoverBaum / 1st-Readme.md
Created April 9, 2018 09:44
Mongo using Docker.

Mongo using Docker

This gist detailes scripts you can use to run a Mongo instance for your development using docker.

The provided scripts help you to create, run, stop and interact with a local mongo Database. You should keep in mind that all data is stored inside the Docker container and will be lost when you destroy it.

outline for "The rise of headless CMS"

Motivation

Should contain what CMS are and motivate that they are great.

Old days

Story telling time of what used to be a pain for me when working with CMS to motivate the move from traditional CMS to headless.

const createAndPublishCategories = async (categories, spaceId, managementToken, simpleLog = console.log) => {
const client = contentful.createClient({
accessToken: managementToken,
logHandler: (level, data) => simpleLog(`${level} | ${data}`)
})
const space = await client.getSpace(spaceId)
const createdCategories = await Promise.all(categories.map(category => new Promise(async resolve => {
let cmsCategory
try {
cmsCategory = await space.createEntry('blogCategory', {
const generateAssetsList = (posts, baseUrl, simpleLog = console.log) => new Promise(async resolve =>{
const apiURL = `${baseUrl.replace(/\/$/, '')}/wp-json/wp/v2/media`
simpleLog('Reducing posts to asset numbers')
let infosFetched = 0
// First add the featured_media images and get ther URLs.
const featuredAssets = await Promise.all(posts.reduce((all, post) => {
if (!post.featured_media) return all
return all.concat([{
mediaNumber: post.featured_media,
const getCategories = (posts, baseUrl, simpleLog = console.log) => new Promise(async resolve => {
const apiURL = `${baseUrl.replace(/\/$/, '')}/wp-json/wp/v2/categories`
// First reduce posts to an array of category numbers.
simpleLog('Reducing posts to category numbers')
const categories = await Promise.all(posts.reduce((all, post) => {
if(!post.category) return all
if(all.indexOf(post.category) > -1) return all
return all.concat([post.category])
}, [])
.map(async categoryNumber => {
const transformPosts = posts => posts.map(post => {
delete post._links
delete post.guid
delete post.excerpt
delete post.author
delete post.comment_status
delete post.ping_status
delete post.template
delete post.format
delete post.meta
const exportBlogposts = (apiUrl, log) => new Promise(resolve => {
const exportPageOfPosts = (apiUrl, page = 1, allPosts = []) => {
log(`Getting posts for page ${page}`)
const url = `${apiUrl}?page=${page}`
https.get(url, (res) => {
// When we get a 404 back we went one page over those with posts.
// So we are done now.
if(res.statusCode === 400) {
return resolve(allPosts)
}