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
@HoverBaum
HoverBaum / create-and-publish-assets.js
Last active March 16, 2020 14:05
Create and publish assets in Contentful.
const createAndPublishAssets = (assets, managementToken, spaceId, locale, simpleLog = console.log) => new Promise(async resolve => {
simpleLog('Creating Contentful client')
const client = contentful.createClient({
accessToken: managementToken,
logHandler: (level, data) => simpleLog(`${level} | ${data}`)
})
const iterableAssets = makeIterator(assets)
const space = await client.getSpace(spaceId)
const cmsAssets = []
@HoverBaum
HoverBaum / Readme.md
Last active March 4, 2020 05:34
Filter empty assets from Contentful export.

Using the Contentful Export tool I noticed that you can currently run into a situation where you export assets that have no files linked which will through an error when you try to pass the exported json into the Contentful Import tool as discussed in issue 95.

As a temporary solution I wrote myselve this script that you can pipe data through to filter out these malformed assets.

cat export.json | node filter-empty-assets.js > filtered-export.json

Now you can use the filteres-export.json for your import and it should work.

@HoverBaum
HoverBaum / create-blogposts.js
Created March 22, 2018 13:12
Creating blogposts in Contentful.
const createBlogPosts = async (posts, assets, categories, managementToken, spaceId, simpleLog = console.log) => {
const client = contentful.createClient({
accessToken: managementToken,
logHandler: (level, data) => simpleLog(`${level} | ${data}`)
})
const space = await client.getSpace(spaceId)
const linkMap = new Map()
assets.forEach(asset => linkMap.set(asset.wpAsset.link, asset.fields.file['en-US'].url))
#!/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 / .travis.yml
Created August 11, 2016 03:19
Deploy Hexo blog using Travis.
# Deploy hexo site by travis-ci
# https://github.com/jkeylu/deploy-hexo-site-by-travis-ci
# LICENSE: MIT
#
# 1. Copy this file to the root of your repository, then rename it to '.travis.yml'
# 2. Replace 'YOUR NAME' and 'YOUR EMAIL' at line 29
# 3. Add an Environment Variable 'DEPLOY_REPO'
# 1. Generate github access token on https://github.com/settings/applications#personal-access-tokens
# 2. Add an Environment Variable on https://travis-ci.org/{github username}/{repository name}/settings/env_vars
# Variable Name: DEPLOY_REPO
@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', {