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
#!/bin/bash | |
target_branch="production" | |
working_tree="PATH_TO_DEPLOY" | |
while read oldrev newrev refname | |
do | |
branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then | |
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
<!-- Inspired by Laravel Paginator. © Gerardo J. Báez <g@gerardobaez.com> 2017. Released with MIT License. --> | |
<template> | |
<ul class="pagination"> | |
<li v-if="hasPrev()"><a href="javascript:void(0)" @click="prev()" class="prev">Previous</a></li> | |
<template v-for="page in getPageSlider()"> | |
<li v-if="isNaN(page) === false"> | |
<a href="javascript:void(0)" :class="{ 'active': currentPage == page }" @click="goToPage(page)">{{ page }}</a> | |
</li> | |
<li v-else class="blank">...</li> | |
</template> |
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
/** | |
* Translation helper methods. | |
* | |
* Requries lodash. | |
* | |
* @author Gerardo J. Báez <g@gerardobaez.com> | |
* @license MIT | |
*/ | |
/** |
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 | |
/** | |
* Get browser language, given an array of avalaible languages. | |
* | |
* @param [array] $availableLanguages Avalaible languages for the site | |
* @param [string] $default Default language for the site | |
* @return [string] Language code/prefix | |
*/ | |
function get_browser_language( $available = [], $default = 'en' ) { | |
if ( isset( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ] ) ) { |