Skip to content

Instantly share code, notes, and snippets.

View bigandy's full-sized avatar

Andrew Hudson bigandy

View GitHub Profile
@bigandy
bigandy / settings.json
Created October 12, 2018 13:56
Work vscode settings
{
// "window.zoomLevel": 1,
"workbench.startupEditor": "newUntitledFile",
"editor.tabCompletion": true,
"editor.detectIndentation": true,
// "editor.formatOnPaste": true,
"terminal.external.osxExec": "Hyper.app",
"editor.autoIndent": false,
"editor.insertSpaces": false,
@bigandy
bigandy / image-replacement.js
Last active September 18, 2018 13:53
404 image replacement
[...document.querySelectorAll('img')].forEach(image => image.addEventListener('error', () => {
image.src = image.src.replace(window.location.origin, 'https://brokernotes.co');
}));
@bigandy
bigandy / guids-for-template-list.sql
Created August 31, 2018 13:18
WordPress Get list of post guids for template type with SQL
SELECT
posts.guid
FROM wp_pswe_posts AS posts
JOIN wp_pswe_postmeta AS template ON posts.ID = template.post_id
WHERE template.meta_key='_wp_page_template'
AND template.meta_value='templates/vs-page-v4.php'
// nginx redirect rule
if ($request_uri ~* \.(js|css|png|jpg|jpeg|gif|svg)) {
rewrite ^/(.+)\.(?:[a-z0-9]+)\.(js|css|png|jpg|jpeg|gif|svg) https://$host/$1.$2 permanent;
}
@bigandy
bigandy / .block
Created January 10, 2018 17:18
Thing
license: mit
@bigandy
bigandy / .block
Last active January 10, 2018 17:20
fresh block
license: mit
@bigandy
bigandy / .block
Last active January 10, 2018 17:00
fresh block
license: mit
@bigandy
bigandy / .bash_prompt
Created November 20, 2017 16:03
VH Bash Prompt
# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Screenshot: http://cloud.gf3.ca/M5rG
# A big thanks to \amethyst on Freenode
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif [[ $TERM != dumb ]] && infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then
tput sgr0
@bigandy
bigandy / App.js
Created November 15, 2017 15:42
SimpleForm React App.js
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import SimpleForm from './SimpleForm';
class App extends Component {
render() {
return (
<div className="App">
@bigandy
bigandy / Simpleform.js
Created November 15, 2017 15:41
LF SimpleForm React Component
import React, { Component } from 'react';
class SimpleForm extends Component {
componentDidMount() {
if (document.getElementById('lf-load-scripts') === null) {
var s = document.createElement('script');
s.id = 'lf-load-scripts';
s.type = 'text/javascript';
s.src =
'https://d2erq0e4xljvr7.cloudfront.net/assets/js/leadformly-embed_advance.min.js';