A Pen by Grant Jenkins on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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": "*", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 // |