Skip to content

Instantly share code, notes, and snippets.

View drawcard's full-sized avatar
👍

Drawcard drawcard

👍
  • Drawcard
  • Australia
View GitHub Profile
@rosemarydotworld
rosemarydotworld / Starting Recipe
Last active October 20, 2016 05:55
How does Liam start projects? Let's find out!
* Reset (either normalize.css or Eric Meyer's reset.css)
* Bourbon
* Neat
* Variables
* Standard colors (go for $red instead of $error)
* Standard sizes
* Font stacks
* Standard media query parameters (named)
* Utilities/
@PatelUtkarsh
PatelUtkarsh / backup-sites.sh
Last active February 7, 2017 10:52
Backing up small wp site with DB
#!/bin/bash
# Generate your Dropbox token: https://www.dropbox.com/developers/apps
DROPBOX_TOKEN={dropbox access token here}
# Directory that holds your WordPress sites' root folders
PREFIX=/var/www
# If you have multiple folders with WordPress sites, add/remove them from this array
directories=( "foo.com" "bar.com" )
# ---- DB Search-Replace and Backup Script ----
# Note: This requires WP-CLI to be installed http://wp-cli.org/
#
# This will generate new SQL file for import to new URL
# 1. Old DB - for Backup purpose (old URL): backup-yymm.sql
# 2. Replaced DB - ready for deploy (new URL): replaced-yymm.sql
#
# Replace aaa.com to bbb.com in the script below
#
# Note: Sometimes you need to change permission with
@bullrico
bullrico / breakpoints.scss
Last active March 26, 2017 18:00
Media breakpoints for Bourbon and Neat
// Columns
$mobile-portrait-columns: 4;
$mobile-landscape-columns: 4;
$tablet-portrait-columns: 8;
$tablet-landscape-columns: 8;
$desktop-columns: 12;
// Portrait
@AJ-Acevedo
AJ-Acevedo / admin-bar-fix.css
Last active April 25, 2017 00:39
WordPress 3.6 and Bootstrap 3 Admin bar overlap fix
// This fixes the WordPress admin-bar 28px overlap issue with Bootstrap 3.
body.admin-bar .navbar {
position:fixed;
top: 28px;
z-index: 1000;
height: 40px;
// If the above does not work try this if your nav is wrapped in .header
@codeablehq
codeablehq / backup.sh
Last active July 3, 2017 07:07
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/
@davemac
davemac / pushstage
Last active November 15, 2017 05:29
wp-cli alias to push a local WP database to a staging site
# wp-cli alias to push a local WP database to a staging site
pushstage() {
START=$(date +%s)
# make a backup of the current local database
# get current directory name, used for database and URL
current=${PWD##*/}
wp db export $current.sql
# rsync the local database to staging site
rsync $current.sql $current-s:~/
# get the staging site URL for search replace
@robinbastien
robinbastien / main.js
Last active January 23, 2018 10:13
CSS Scroll Reveals (Simple WOW.js alternative)
// Get height of window and set an offset from bottom
var winHeight = $(window).height();
var offset = 50;
// Recalc height of window in case of resize
$(window).bind('resizeEnd', function() {
winHeight = $(window).height();
});
// When we scroll we do some checks...
@slushman
slushman / wp_auto_install.sh
Last active December 14, 2018 03:11 — forked from nicomollet/wp_auto_install.sh
WP-CLI auto install local development site script
#!/bin/bash
# Get the required project variables
printf "Project name: "
read PROJECT_NAME
printf "Project folder name: "
read PROJECT_FOLDER
printf "Database Name: "