Remove untracked/ignored files/directories and uncommitted changes.
$ git clean -xfd
$ git submodule foreach --recursive git clean -xfd
$ git reset --hard
#!/usr/bin/env bash | |
# PHP Switcher | |
# Easily switch between PHP versions with Homebrew and Laravel Valet. | |
# Copyright (C) Kyle Brumm <http://kylebrumm.com> | |
# | |
# Credit/Resources: | |
# https://gist.github.com/bgarrant/b9a2f7fb8ff06c9a45086359ded7a95e | |
# https://raw.githubusercontent.com/conradkleinespel/sphp-osx/master/sphp |
<?php | |
/** | |
* Make sure a string never has a widow. | |
* | |
* @param string $text The string to dewidow | |
* @param int $min_words Minimum number of words to dewidow | |
* @return string The dewidowed string | |
*/ | |
function dewidow( $text = '', $min_words = 3 ) { | |
$return = trim( $text ); |
<?php | |
/** | |
* Include a theme partial and pass data to it. | |
* | |
* @param string $partial Partial file to include | |
* @param array $data Data to pass to the partial | |
* @return void | |
*/ | |
function theme_include( $partial, $data = [] ) { | |
if ( ! strstr( $partial, '.php' ) ) { |
#!/usr/bin/env bash | |
echo "==================================================" | |
echo "Setting up Magento 2 Vagrant box with..." | |
echo "- Ubuntu 14.04 LTS" | |
echo "- Apache 2.4" | |
echo "- PHP 7.0" | |
echo "- MySQL 5.6(manual)" | |
echo "- Git" |
<?php | |
/** | |
* Check if an array key/val(optional) exist in an array and optionally return the values | |
* | |
* @param array $array The array to check for the key/val | |
* @param string $key Key to search for | |
* @param string $value Value to search for | |
* @return bool | |
*/ | |
function r_search_array($array, $key, $value=null, $return=false) { |
// Initialize Parallax | |
var parallax_el = document.querySelectorAll('[data-parallax]'); | |
var speed = 0.25; | |
function updateElementPosition() { | |
[].slice.call(parallax_el).forEach(function(el,i) { | |
var speed = el.dataset.parallax || 0.25; | |
var offset = (-(window.pageYOffset - el.offsetTop) * speed); | |
el.style.transform = 'translate3d(0, ' + offset + 'px, 0)'; | |
el.style.OTransform = 'translate3d(0, ' + offset + 'px, 0)'; |