Skip to content

Instantly share code, notes, and snippets.

View annedorko's full-sized avatar

Anne Dorko annedorko

View GitHub Profile
@annedorko
annedorko / README.md
Last active June 3, 2024 20:27
TailwindCSS plugin for variable fonts: Italic, Width/Stretch, Weight
@annedorko
annedorko / gatsby-image-component.js
Created March 12, 2022 10:22
SVG Friendly Gatsby Image Component
import React from "react";
import {StaticQuery, graphql} from "gatsby";
import {GatsbyImage} from "gatsby-plugin-image";
export const Image = props => (
<StaticQuery
query={graphql`
query {
images: allFile {
edges {
@annedorko
annedorko / wp-update-all.sh
Created April 8, 2018 09:26
Find and update all WordPress sites on Ubuntu 16.04
#!/bin/bash
# Find, backup, and update all WordPress installations
# In progress, test for your configuration first
# Requires wp-cli and tar to be installed
# https://wp-cli.org/
#
# Written for storing backups on mounted drive, but you can set to whatever folder you want
# Backs up databse and wp-content every other day
# Zips backups to save storage space
# Organized by BACKUP FOLDER > Date > Domain
@annedorko
annedorko / wp-permissions.sh
Created April 8, 2018 08:33
Set WordPress file permissions on Ubuntu 16.04
#!/bin/bash
# Automatically sets appropriate permissions on WordPress files
# ===== Expects multiple sites stored under /var/www/{sitename}/html
if [[ $* == *--all* ]]; then
echo "Reset permissions for all WordPress sites? (Y/n)"
read accept
find /var/www -name 'wp-config.php' -exec dirname {} \; > ~/wp_list.txt
else
@annedorko
annedorko / make-srt.php
Created March 23, 2017 18:18
Turn copy & paste Facebook video captions into a .SRT file
<?php
/**
* Facebook Video Caption Editor Copy & Paste to SRT
*
* Original script by Anne Dorko
*
* Why? I tried adding custom Facebook captions to my live video,
* and it wouldn't save. 45 minutes of my life wasted! But wait...
* I copied and pasted the timestamps and subtitles into a plain
* text file and then processed it to create an .SRT
@annedorko
annedorko / post-receive
Last active February 27, 2017 09:01
post-receive hook for deploying Twist themes
GIT_REPO=/PATH/TO/SITE/PARENT/deploy.git
TMP_GIT_CLONE=/PATH/TO/SITE/PARENT/tmp
PUBLIC_WWW=/PATH/TO/SITE/PARENT/public_html/wp-content/themes/THEME/
# Clone repo into a temporary folder
git clone $GIT_REPO $TMP_GIT_CLONE
# Generate style.css
sass $TMP_GIT_CLONE/_scss/style.scss:$TMP_GIT_CLONE/style.css --style compressed
# Remove extraneous files, delete current public theme
rm -Rf $TMP_GIT_CLONE/_scss/ $TMP_GIT_CLONE/style.css.map $PUBLIC_WWW