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 / 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 / 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 / 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 / todays-changes.sh
Created October 23, 2017 20:26
[Today's changes] #gitTricks
git log --since="1 day ago" --name-only --pretty=format: | sort | uniq
@Andy-set-studio
Andy-set-studio / diff.sh
Created October 23, 2017 20:29
[Git diff against other branch] #gitTricks
git diff --name-only OTHER_BRANCH_HERE
@Andy-set-studio
Andy-set-studio / stroke.svg
Created October 23, 2017 20:32
[Static stroke width] Prevents fat stroke for svg paths with vector effects. Codepen: http://codepen.io/hankchizljaw/pen/OXvxyr
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Andy-set-studio
Andy-set-studio / jump.js
Created October 23, 2017 20:35
[jQuery Jump module] Used for creating a smooth transition for anchor links etc. Will automatically look for bindable elements on 'DOMNodeInserted DOMNodeRemoved' events for ajax content insertions etc. Also utilises history API. #jQuery #legacyJSToRefactor
(function ($) {
$.fn.jump = function (options) {
var elem = $(this),
settings = {
scrollingParent: $('html, body'),
offsetPadding: 0,
scrollSpeed: 800,
target: []
};
@Andy-set-studio
Andy-set-studio / to-rem.scss
Created June 20, 2018 12:34
Convert pixel value to REM
/**
* To Rem
* -------------------------------------//
* Convert pixel value to REM
*/
@function to-rem($pixel-size: 16) {
@return ($pixel-size / 16) * 1rem;
}
@Andy-set-studio
Andy-set-studio / .eleventy.js
Last active August 20, 2018 19:35
Eleventy sort by order
const sortByOrder = require('./sort-by-order.js');
module.exports = function(eleventyConfig) {
eleventyConfig.addFilter('sortByOrder', sortByOrder);
}
@Andy-set-studio
Andy-set-studio / stylebot.css
Created August 20, 2018 14:17
Custom styles to help me only check messages and notifications periodically on Twitter
.moments, .top-timeline-tweetbox, .dashboard-left, .dashboard-right, .home, .form-search, .right-actions {
display: none;
}
.content-main {
float: none;
margin: 0 auto;
}