Skip to content

Instantly share code, notes, and snippets.

@ethicka
ethicka / pdf-to-jpg.sh
Last active October 9, 2020 14:33
Convert a folder of PDFs to JPGs
#!/bin/bash
# Dependencies: vips
# Homebrew: brew install vips
for file in *.pdf
do
# Run vips pdfload for options
# You could add --page=1 to get the second page (from 0) or --dpi=300, etc. to get different quality images
# The variable gets the filename without the extension
vips pdfload ${file%.*}.pdf ${file%.*}.jpg
done
@itsdavidmorgan
itsdavidmorgan / gutenberg.css
Last active January 5, 2020 18:59
Back-end Styles For Gutenberg Content Editor
/************************************************
Gutenberg Editor
************************************************/
.block-editor .wp-block {
max-width: 760px;
}
.block-editor .wp-block[data-align="wide"] {
max-width: 920px;
}
@ethicka
ethicka / sage9-deploybot.md
Last active May 4, 2020 07:24
How to build and deploy a Roots / Sage 9 WordPress theme on Deploybot

Deploying Roots Sage 9 via Deploybot

Sage 9 is the latest and greatest from Roots, but the build process is much more complicated than Sage 8 (i.e. gulp --production and profit). The following took me quite a bit of time to figure out, but is probably not comprehensive. Please comment if you need clarity. I hope it saves you some time!

Build the Container

Deploybot allows you to create your own containers. Go to Settings > Containers > Create a container. Based off the Ubuntu 16.04 container add the following build commands and save as Sage 9:

@ethicka
ethicka / localhost-ssl-certificate.md
Last active February 18, 2024 16:29
Localhost SSL Certificate on Mac OS

🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!


This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

@ryanscherler
ryanscherler / php-openssl.md
Last active August 16, 2018 20:06
Use Homebrew PHP with OpenSSL instead of SecureTransport
@rcugut
rcugut / node-npm-install.md
Last active February 2, 2024 11:51 — forked from DanHerbert/fix-homebrew-npm.md
Install node & npm on Mac OS X with Homebrew

DEPRECATED as of macOS 10.13 (High Sierra). See the new GUIDE to install nvm and yarn for macOS (updated July 2019)

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

@ethicka
ethicka / localhost-ssl.md
Last active April 12, 2024 12:26 — forked from jonathantneal/README.md
Local virtualhost SSL websites on Mac OS Sierra

Local virtualhost SSL websites on Mac OS Sierra

These instructions will guide you through the process of setting up a wildcard SSL for your local virtualhosts for offline development. Most importantly, this configuration will give you the happy, green lock in Chrome.

These instructions have only been tested on Mac OS Sierra using the pre-installed Apache and PHP versions. These instructions also assume you have virtualhosts set up locally already.


Configuring SSL

@jaywilliams
jaywilliams / deploy.rb
Last active July 11, 2022 00:32 — forked from el-rotny/deploy.rb
set :repo_url, 'git@github.com:Design-Collective/some-repo.git'
set :application, 'the-app-name.com'
set :theme_name, 'sage'
# Branch options
# Prompts for the branch name (defaults to current branch)
#ask :branch, -> { `git rev-parse --abbrev-ref HEAD`.chomp }
# Hardcodes branch to always be master
# This could be overridden in a stage config file
@el-rotny
el-rotny / deploy.rb
Last active July 11, 2022 00:32
Bedrock / Sage Capistrano Deploy
set :repo_url, 'git@github.com:Design-Collective/some-repo.git'
set :application, 'the-app-name.com'
set :theme_name, 'sage'
# Branch options
# Prompts for the branch name (defaults to current branch)
#ask :branch, -> { `git rev-parse --abbrev-ref HEAD`.chomp }
# Hardcodes branch to always be master
# This could be overridden in a stage config file
@boogah
boogah / ale.bash
Last active July 11, 2022 00:32
Never think about maintaining your homebrew install again with this shitty (but useful) shell script & cron job!
#!/bin/bash
echo ""
echo "`date`: RUNNING: brew update"
/usr/local/bin/brew update
echo "`date`: FINISHED: brew update"
echo ""