Skip to content

Instantly share code, notes, and snippets.

View apbassi89's full-sized avatar

Alessandro Bassi apbassi89

View GitHub Profile
<?php
// ...
protected $middleware = [
// ...
'App\Http\Middleware\ValidProxies',
];
// ...
/**
* Performs a "mini" heading audit of a webpage.
* The page must have jQuery loaded in order for this script to work
*/
function auditHeadings() {
var headings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
console.log("===== STARTING HEADING AUDIT =====")
jQuery.each(headings, function (key, selector) {
var headingsEl = jQuery(selector);
if (!headingsEl.length) {
@apbassi89
apbassi89 / git-reset-fork-to-upstream-master.md
Last active September 28, 2016 18:55
Git commands which clean your fork's master (and dev) branch commit history to match an upstream master branch

Overview

This gist is intended for users who follow a forked repository/pull-request git workflow. Overtime, you may notice your forked repository's master branch becomes cluttered with "merged upstream/master into master"-type commits. These commits don't serve much of a purpose, and tend to clutter the commit history of any new pull requests you make.

By running the scripts below, we will delete your old master and create a new one based off of upstream/master. This will remove all of those unnecessary commits we don't want to see anymore. Based on the nature of how this works, you should be aware of a few things:

  • This method relies on a force push, and "erases" git history. This is a bad practice, especially when working on the same repository with other people, so make sure you understand the consequences of a force push before you do it.
  • Any work you have in your fork's master branch must have been merged to upstream/master or saved in another branch. If not, you will lose it all.
  • I