Skip to content

Instantly share code, notes, and snippets.

bwonur /
Created July 18, 2019 06:48
Seo Checklist
KelliePetersen /
Last active June 6, 2023 12:51
SEO Checklist updated for 2019
GAS85 /
Last active February 7, 2023 16:17
How to Enable HTTP/2 in Apache 2.4 on Ubuntu 16.04


  • A self-managed VPS or dedicated server with Ubuntu 16.04 running Apache 2.4.xx.
  • For Ubuntu 18.04 please read here -->
  • A registered domain name with working HTTPS (TLS/SSL). HTTP/2 only works alongside HTTPS because most browsers, including Firefox and Chrome, don’t support HTTP/2 in cleartext (non-TLS) mode.
ericrasch / SEO
Last active August 7, 2021 20:38
SEO Checklist
jimfb /
Last active July 13, 2019 06:35
addComponentAsRefTo Invariant Violation

You are probably here because you got the following error messages:

addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded.

This usually means one of two things:

  • You are trying to add a ref to an element that is being created outside of a component's render() function.
  • You have multiple (conflicting) copies of React loaded (eg. due to a miss-configured NPM dependency)

Invalid Refs

nvanselow / gist:f00b890c921da937ddb6
Last active July 7, 2023 19:02
Installing Selenium on Laravel Homestead

Install Selenium and PhantomJS on Laravel Homestead

All commands are in the terminal.

  1. SSH into the Homestead Box - vagrant ssh from homestead directory
  2. Create a new folder for Selenium - mkdir selenium from the ~ directory
  3. Navigate to that folder - cd selenium
  4. Get Selenium - wget *Note: This link comes from copying the link on
  5. Install Java - sudo apt-get install openjdk-7-jre-headless
antonioribeiro / gist:96ce9675e5660c317bcc
Created July 23, 2014 21:49
Codeception, Javascript and Laravel Homestead

You can use Codeception to test Javascript, like DOM manipulations and Ajax requests. Out of the box it can manipulate DOM elements but can't execute Javascript code, like most testing frameworks. But it gives you the option to use a WebDriver, to connect to a headless browser, and mimic a user browsing your website. It gives you some options: Selenium2, ZombieJS and, the easiest to configure, PhantomJS.

This article covers the installation and usage of PhantomJS, and assumes you are using Laravel Homestead, but it will work on any relatively new Debian based distro, like Ubuntu 14.04.

###Install PhantomJS

Just run those commands to install it:

sudo apt-get update
codeguy / slugify.js
Created September 24, 2013 13:19
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
nichtich /
Last active May 20, 2024 07:48 — forked from oodavid/
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
Adirael /
Created August 17, 2012 23:16
Fix wordpress file permissions
# This script configures WordPress file permissions based on recommendations
# from
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory