Skip to content

Instantly share code, notes, and snippets.

@thedigitaloctopus
thedigitaloctopus / installables.sh
Created May 29, 2023 13:33 — forked from Callisto13/installables.sh
Script to install things (kind, docker, clusterctl, kubectl) ready to run CAPI in kinD
#!/bin/bash -ex
mkdir -p $HOME/installables
pushd $HOME/installables
wget https://github.com/kubernetes-sigs/kind/releases/download/v0.13.0/kind-linux-amd64
chmod +x ./kind-linux-amd64
mv ./kind-linux-amd64 /usr/local/bin/kind
kind --version
@thedigitaloctopus
thedigitaloctopus / notion2blog.js
Created August 12, 2022 06:10 — forked from mayneyao/notion2blog.js
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@thedigitaloctopus
thedigitaloctopus / setup-phpunit.sh
Created March 3, 2022 14:51 — forked from keesiemeijer/setup-phpunit.sh
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
@thedigitaloctopus
thedigitaloctopus / pushstage()
Created March 3, 2022 13:51 — forked from davemac/pushstage()
push a local WP database to an existing staging site
# push a local WP database to an existing staging site
# uses current directory as theme path and ssh alias
pushstage() {
START=$(date +%s)
# make a backup of the current local database
# get current directory name, used for database and URL
current=${PWD##*/}
cd ~/Sites/$current || return
# rsync the local database to staging site
// functions.php //
function custom_post_excerpt_length($post_excerpt, $post)
{
$length = 70;
$excerpt = strlen($post_excerpt) > $length ? mb_substr($post_excerpt, 0, $length - 3, "utf-8") . "..." : $post_excerpt;
return $excerpt;
}
add_filter('get_the_excerpt', 'custom_post_excerpt_length', 20, 2);
// end functions.php //