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
#/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# forked by Gianluca Guarini | |
# phponly by Ivo Bathke ;) | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" | |
} |
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
define(['masonry/masonry', 'imagesloaded/imagesloaded'], function(Masonry, imagesLoaded) { | |
$(document).ready(function() { | |
var container = document.querySelector('#masonry'); | |
imagesLoaded(container, function() { | |
var msnry = new Masonry(container, { | |
columnWidth: 200, | |
gutter: 20, | |
itemSelector: '.item', | |
isFitWidth: true | |
}); |
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 | |
class MemberProfileFieldExtension extends DataExtension { | |
public static $db = array( | |
'SortOrder' => 'Int' | |
); | |
function updateCMSFields(FieldList $fields) { | |
$fields->push(new NumericField('SortOrder', 'SortOrder')); |
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
$cache = $container->get('liip_doctrine_cache.ns.[mynamespace]'); | |
if (false === ($cached_data = $cache->fetch($cache_key))) { | |
$cached_data = $SOMEAPI->getData($params); | |
$cache->save($cache_key, $cached_data, 3600);//TTL 1h | |
} |
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
$cache = $this->get('cache'); | |
$cache->setNamespace('mynamespace.cache'); | |
if (false === ($cached_data = $cache->fetch($cache_key))) { | |
$cached_data = $SOMEAPI->getData($params); | |
$cache->save($cache_key, $cached_data, 3600);//TTL 1h | |
} |
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/sh | |
#install SilverStripe3 CMS | |
#usage sh install_silverstripe3.sh | |
DEFAULT_BROWSER="/usr/bin/firefox" | |
RELEASE="SilverStripe-cms-v3.0.1.tar.gz" | |
RELEASE_FOLDER="SilverStripe-cms-v3.0.1" | |
echo "-------------- Install $RELEASE from web :) ---------------" | |
echo "Type your Project Folder:" |
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
public function registerContainerConfiguration(LoaderInterface $loader) { | |
if ($this->getEnvironment() == 'dev') { | |
$extrafiles = array( | |
__DIR__ . '/config/config_local.yml', | |
); | |
foreach ($extrafiles as $filename) { | |
if (file_exists($filename) && is_readable($filename)) { | |
$loader->load($filename); | |
} |
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 | |
/** | |
* Tweaked Symfony2 bootstrap file | |
*/ | |
// if you don't want to setup permissions the proper way, just uncomment the following PHP line | |
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information | |
umask(0000); | |
if ( file_exists( dirname(__FILE__).'/../.env.php' ) ){ |
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
# install silverstripe + common modules from github | |
# usage sh install_silverstripe.sh <folder_name> <tag/branch> | |
# examples: | |
# sh install_silverstripe.sh some_folder tags/2.4.5 | |
# sh install_silverstripe.sh some_folder master | |
#set up project base folder | |
git clone git@github.com:silverstripe/silverstripe-installer.git $1 | |
cd $1 | |
git checkout $2 |
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__ . '/../vendor/silex/silex.phar'; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Symfony\Component\HttpKernel\Exception\HttpException; | |
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | |
$app = new Silex\Application(); |