Skip to content

Instantly share code, notes, and snippets.

View drawcard's full-sized avatar
👍

Drawcard drawcard

👍
  • Drawcard
  • Australia
View GitHub Profile
@drawcard
drawcard / backup.sh
Last active February 7, 2017 12:36 — forked from codeablehq/backup.sh
A script that creates a backup of your WordPress site and uploads it to Dropbox
#!/bin/bash
# For this script to work, save it somewhere in the executable path, like /usr/local/sbin/backup.sh
# make it executable: chmod +x /usr/local/sbin/backup.sh
# then add it to cron: crontab -e
# and add the line below, which will run backup 3am each day, then upload to Dropbox
# 0 3 * * * /usr/local/sbin/backup.sh > /dev/null 2>&1
# You also need WP CLI installed: http://wp-cli.org/
@drawcard
drawcard / db-backup.sh
Created July 10, 2016 10:02
MYSQL Nightly Backup Script
#-------
# MYSQL NIGHTLY BACKUP SCRIPT
# Adapted from: http://www.linuxbrigade.com/back-up-all-of-your-mysql-databases-nightly/
# Add this to line to cron as root for nightly backups (sudo crontab -e)
# 30 3 * * * /usr/local/bin/mysql_backup.sh
#-------
# Change the directory to suit you
DB_BACKUP="/var/www/public/mysql-backup/`date +%Y-%m-%d`"
DB_USER="root"
DB_PASSWD="root"
@drawcard
drawcard / monit-custom-config-settings.txt
Created February 26, 2016 05:49
Monit custom config settings
check process apache with pidfile /run/apache2.pid
start program = "/etc/init.d/apache2 start" with timeout 60 seconds
stop program = "/etc/init.d/apache2 stop"
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
set httpd port 2812
use address localhost # only accept connection from localhost
@drawcard
drawcard / sass-responsive-mixin.scss
Created January 20, 2016 11:04 — forked from peschee/sass-responsive-mixin.scss
SASS responsive mixin (bootstrap breakpoints)
/**
* Responsive mixin. The media breakpoints are as defined
* in the twitter bootstrap framework:
*
* - phone
* - tablet-portrait
* - tablet-landscape-desktop
* - large-desktop
*
* Additional parameters for tagetting retina and non-retina
@drawcard
drawcard / the-new-vagrant-server-experience.md
Last active January 29, 2016 07:44
The New Vagrant Server Experience®

So you want a Vagrant Server with LAMP, Gulp, Bower, NPM, blah blah. And you want it done today, not next Christmas.

"Sounds good Chris, I don't feel like copying hundreds of lines of text from the Ubuntu Help Forum."

Scotch Box NAO

Now I have a great LAMP box running, what next?

  • Install some useful system stuff:
@drawcard
drawcard / woocommerce-sage-template-part-overrides.md
Last active August 16, 2021 08:39
Woocommerce - Using template part overrides in Sage

So, you know how to override a template file in Woocommerce using Sage, but you're having trouble changing something within the deeper level of that template file. For example, you want to change the output HTML structure of a given part of the product page loop, or incorporate a Bootstrap class into a button element without using Jquery to inject it. Here's how you can override deeper level parts, the default WC theme elements.

Prerequisites

Now you're familiar with how to do Sage + Woocommerce templates, it's time to make it happen.

The template page override

@drawcard
drawcard / migrate-theme.md
Last active May 15, 2016 09:00
Rebase an existing theme onto a fresh / updated copy of the theme framework
git clone <a copy of sage theme>
git add remote temp location@of.old.theme.com:/var/www/site/wordpress/wp-content/themes/build #original / old theme
git fetch temp
git checkout temp/master -b wip #checkout a copy of the old theme
git remote add https://github.com/roots/sage.git sage #fetch fresh theme
git fetch sage
git checkout sage/master -b sage #checkout a new branch
git rebase wip #rebase wip and sage together to create a new updated theme
@drawcard
drawcard / pdf-svg-ai.md
Last active August 29, 2015 14:23
Importing PDF / SVG wireframes into AI and getting good results
  1. Open up the SVG or PDF in illustrator
  2. Select everything and run Ungroup (Shift-Cmd-G) several times until everything is ungrouped
  3. Go to Select > Object > Clipping Masks
  4. Object > Clipping Paths > Release
  5. Select an invisible clipping mask box and choose Select > Same > Fill & Stroke
  6. Bonus: Convert broken blocks of text to Point Type (Text > Convert to Point Type) and then run joinTextFrames.js
@drawcard
drawcard / type-design-workflow.md
Last active March 16, 2023 16:36
Typeface Design Workflow

Type Design Workflow / Checklist

Tools

Before We Begin

  • These notes can be generally followed in order however some steps will likely be done constantly throughout the design process until the typeface matures - eg. sketching, kerning, testing etc.
  • Read the Glyphs Tutorials for understanding common functions talked about below.
@drawcard
drawcard / new-mac-setup.md
Last active August 29, 2015 14:22
New Macbook Pro - Setup and Install Process