This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function( $ ) { | |
// This script needs the 'hashchange' event to work | |
if ( 'undefined' === typeof window.onhashchange ) { | |
return; | |
} | |
var historyLengthBeforeGallery = 0; | |
// Catch the first hash change, ie: when the first slide opens | |
jQuery( window ).on( 'hashchange', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_latest_of_type( $post_type, $number ) { | |
$args = array( | |
'post_type' => $post_type, | |
'posts_per_page' => min( 10, $number ), | |
'no_found_rows' => true, | |
); | |
$query = new WP_Query( $args ); | |
while ( $query->have_posts() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/pluginception.php' | |
class ShoutPlugin { | |
use Pluginception; | |
function __construct() { | |
/* | |
* This method comes from the Pluginception trait, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# navigate to VVV/www folder | |
cd /path/to/vvv/www | |
# ssh into vagrant | |
vagrant ssh | |
# cd to www directory | |
cd /srv/www | |
# create a directory for the new site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update from SVN repo | |
svn up | |
# Commit the updates into Git repo, using the last revision id of SVN | |
git add .; git commit -m r`svn info $url | grep 'Last Changed Rev' | awk '{ print $4; }'` -n | |
# Merge the feature branch, after CR | |
git merge origin/FEATURE-BRANCH | |
# Run grunt or any pre-svn-commit steps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /tmp/ngrok; cd /tmp/ngrok; wget "https://api.equinox.io/1/Applications/ap_pJSFC5wQYkAyI0FIVwKYs9h1hW/Updates/Asset/ngrok.zip?os=linux&arch=386&channel=stable"; unzip ngrok.zip; ngrok -proto=tcp 22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "127.0.0.1 facebook.com" >> %Windir%\System32\drivers\etc\hosts | |
echo "127.0.0.1 myegy.to" >> %Windir%\System32\drivers\etc\hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# switch to vip git branch | |
git checkout vip | |
# pull updates | |
svn up | |
# reset working tree | |
svn revert --recursive . | |
# try to merge the previous branch ( ie: GNDEV-88 ), but do not auto commit | |
git merge - --no-commit --no-ff | |
# see the svn diff, before committing | |
svn diff | more |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
preview ="!f() { git branch -D preview; git fetch; git checkout preview; git merge -; git push; /path/to/wp-vip-preview/bin/deploy-preview.sh > /dev/null 2>&1; git checkout -; }; f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Content-Type: text/plain"); | |
// Decode the payload | |
$payload = json_decode( $_POST ); | |
# Include config file if found | |
@include( __DIR__ . '/deploy-config.php' ); | |
// Ability to choose a custom branch to track / deploy from, in the webhook registered URL |