Skip to content

Instantly share code, notes, and snippets.

View Andy-set-studio's full-sized avatar

Andy Bell Andy-set-studio

View GitHub Profile
@Andy-set-studio
Andy-set-studio / google-map.js
Created October 23, 2017 20:25
[Fancy Google Map Module] #jQuery #legacyJSToRefactor
(function($) {
$.fn.googleMap = function() {
var elem = $(this),
settings = {
mapOptions: {
zoomControl: false,
streetViewControl: false,
panControl: false,
overviewMapControl: false,
@Andy-set-studio
Andy-set-studio / errors.php
Created October 23, 2017 20:23
Show all PHP errors
error_reporting(E_ALL);
ini_set('display_errors', '1');
@Andy-set-studio
Andy-set-studio / wp-config.php
Created October 23, 2017 20:23
[Override WP Host / Url] Override Wordpress domain. Allows you to override the domain without touching the database. Will resolve all urls to the domain you set
// Local site
define('WP_HOME', 'http://YOURPROJECT.LOCAL/');
define('WP_SITEURL', 'http://YOURPROJECT.LOCAL/');
@Andy-set-studio
Andy-set-studio / command.sh
Last active October 23, 2017 20:20
[Git changes between hashes] Get the changes between two commit hashes. This will create a file called "changes.txt" in the root of your repo with a list of changes. Andy's tip of the day: go one commit back for OLD_HASH because it'll miss the first commit of your changes otherwise 👍 #gitTricks
git diff --name-only OLDEST_HASH NEWSEST_HASH > changes.txt
@Andy-set-studio
Andy-set-studio / .htaccess
Created October 23, 2017 20:19
.htaccess rules to place site in maintenance mode, but allow certain IP Address through
RewriteEngine On
# Allow through given IP Address
RewriteCond %{REMOTE_ADDR} !^95\.128\.11\.149
# Check for presence of Maintenance Page
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
# Check for presence of enable file
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
@Andy-set-studio
Andy-set-studio / font-ligatures.scss
Created October 23, 2017 20:18
Disable font ligatures
.no-ligatures {
font-variant-ligatures: none;
}
@Andy-set-studio
Andy-set-studio / css-for-sup-and-sub.scss
Last active October 23, 2017 20:01 — forked from unruthless/CSS for <sup> and <sub>
CSS for <sub> and <sup>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@Andy-set-studio
Andy-set-studio / .eslintrc
Last active July 9, 2017 21:14
ESLINT template
{
"parser": "babel-eslint",
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
@Andy-set-studio
Andy-set-studio / _system-font.scss
Last active October 23, 2017 20:10
Set base family as system font. Apple San Francisco etc etc
// Set base font family as system fonts as outlined in this article: https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/#what-to-do-today
$base-font-family: -apple-system, BlinkMacSystemFont,
"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
"Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
@Andy-set-studio
Andy-set-studio / _break.scss
Created July 15, 2016 09:39
Add a line break with CSS. Useful for keeping labels inline/inline-block
// Create a line break
&:after {
content: "\A";
white-space: pre;
}