Skip to content

Instantly share code, notes, and snippets.

View bigandy's full-sized avatar

Andrew Hudson bigandy

View GitHub Profile
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"detect_slow_plugins": true,
"disable_colored_group_labels": true,
"disable_coloured_folder_labels": true,
"disable_formatted_linebreak": true,
"fade_fold_buttons": true,
"folder_exclude_patterns":
@bigandy
bigandy / proj.sublime-snippet
Created February 18, 2016 09:56
Sublime Project Snippet that adds default file and folder ignore arrays
<snippet>
<content><![CDATA[
"folder_exclude_patterns": [
"node_modules",
"bower_components",
],
"file_exclude_patterns": [
".babelrc",
".eslintrc*",
"config.json",
@bigandy
bigandy / pwgen-bash-function
Created August 24, 2015 15:32
pwgen Bash Function
pass() {
if [ -n "$1" ]
then
pwgen -sy $1 1 |pbcopy |pbpaste; echo " Has been copied to clipboard"
else
pwgen -sy 40 1 |pbcopy |pbpaste; echo "Has been copied to clipboard"
fi
}
@bigandy
bigandy / resp.php
Last active August 29, 2015 14:17
Resp Images Find strings in string, order independent.
// original HTML, when added to post
<img src="http://boilerplate.dev/wp-content/uploads/2015/03/spiral_01.jpg" alt="spiral_01" width="993" height="1000" class="alignnone size-full wp-image-45" />
// when change the class, order of HTML is changed.
<img class="alignnone wp-image-45 size-full" src="http://boilerplate.dev/wp-content/uploads/2015/03/spiral_01.jpg" alt="spiral_01" width="993" height="1000" />
Need to get:
1. class
i. the number 45 from the end of wp-image-45
@bigandy
bigandy / wordpress.sh
Last active August 29, 2015 14:14
New WordPress build script
#!/bin/bash
function newsite {
local email="andrew@electricstudio.co.uk"
local appdir="/Users/andrew/Sites/$1"
local httpd_vhosts="/etc/apache2/extra/httpd-vhosts.conf"
# local input=$1
# local size=${#input}
# local max="8"
local basedir=$PWD
@bigandy
bigandy / gist:9be72cc647e7a90543a0
Created November 21, 2014 08:51
Sublime Keybindings
[
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" },
{ "keys": ["ctrl+super+w"], "command": "close_all" },
{ "keys": ["super+ctrl+e"], "command": "open_file", "args": {"file": "${project}" } },
// { "keys": ["super+down"], "command": "goto_definition" },
{ "keys": ["super+b"], "command": "toggle_side_bar" },
{
"keys": ["ctrl+alt+left"],
"command": "set_layout",
@bigandy
bigandy / gist:e82df405c02d56e65443
Created November 11, 2014 09:47
Sublime Settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"detect_slow_plugins": true,
"disable_colored_group_labels": true,
"disable_coloured_folder_labels": true,
"disable_formatted_linebreak": true,
"fade_fold_buttons": true,
"folder_exclude_patterns":
@bigandy
bigandy / Useful CLI Commands
Last active February 6, 2017 18:08
Useful CLI Commands
# Prevent need for sudo npm install ...
sudo chown -R `whoami` ~/.npm
# Allow updating of Themes, plugins, Core in WordPress
sudo chown -R andrew:_www <site>
# Copy file from one location to another
# in this case the wordpress template into the test folder
cp -R source/wp test
@bigandy
bigandy / gist:9400717
Created March 6, 2014 22:04
Sass Element and Modifier Mixins
// Mixins for element and modifier
//elements get appended with "__" and the $name
@mixin e($name) {
@at-root &__#{$name} {
@content;
}
}
//modifiers get appended with "--" and the $name
@bigandy
bigandy / newSite.sh
Last active December 28, 2015 18:59
WordPress Installation Script
#!/bin/bash
function newSite {
local appdir="/Applications/XAMPP/htdocs/$1"
local sourcedir="/Applications/XAMPP/htdocs/source"
local author="Andrew JD Hudson"
local themedir="/Applications/XAMPP/htdocs/$1/content/themes/$1"
local starterTheme="es-theme"
local httpd_vhosts="/Applications/XAMPP/etc/extra/httpd-vhosts.conf"