Skip to content

Instantly share code, notes, and snippets.

@ivoba
ivoba / Dockerfile
Created February 20, 2015 16:28
php5.5 with pimple c extension
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
php5-dev \
php5-cli \
php5-fpm \
php5-json \
php5-intl \
@ivoba
ivoba / gist:faf0cff10410024f87e0
Created June 17, 2015 13:07
VarDumper dump javascript error #15015
<script> Sfdump = window.Sfdump || (function (doc) { var refStyle = doc.createElement('style'), rxEsc = /([.*+?^${}()|\[\]\/\\])/g, idRx = /\bsf-dump-\d+-ref[012]\w+\b/; doc.documentElement.firstChild.appendChild(refStyle); function toggle(a) { var s = a.nextSibling || {}; if ('sf-dump-compact' == s.className) { a.lastChild.innerHTML = '&#9660;'; s.className = 'sf-dump-expanded'; } else if ('sf-dump-expanded' == s.className) { a.lastChild.innerHTML = '&#9654;'; s.className = 'sf-dump-compact'; } else { return false; } return true; }; return function (root) { root = doc.getElementById(root); function a(e, f) { root.addEventListener(e, function (e) { if ('A' == e.target.tagName) { f(e.target, e); } else if ('A' == e.target.parentNode.tagName) { f(e.target.parentNode, e); } }); }; root.addEventListener('mouseover', function (e) { if ('' != refStyle.innerHTML) { refStyle.innerHTML = ''; } }); a('mouseover', function (a) { if (a = idRx.exec(a.className)) { refStyle.innerHTML = 'pre.sf-dump .'+a[0]+'{background-col
@ivoba
ivoba / jquery.pump.js
Created July 23, 2011 15:11
jquery pump effect
/*
* this uses jquery UI/Effects/switchClass with transitions
* parameters are:
* normal: starter class
* pump: class to transform to
* interval: time interval
* stop: if the object hast this stopper class it will break,
* you can set the class from the outside
*
* usage: $('.status').pump({normal : 'someclass',
@ivoba
ivoba / post-merge
Created October 7, 2011 15:08
silex, twig, boilerplate build post-merge hook
#!/bin/sh
#
# A hook script that is called after a successful
# merge is made.
# It triggers the boilerplate build.
#
# To enable this hook, make this file executable
# change to build dir
cd ../../build
@ivoba
ivoba / copyViews.xml
Created October 8, 2011 13:38
copyViews Target for boilerplate build
<target name="copyViews">
<echo message="copy Views for build"/>
<mkdir dir="${dir.intermediate}/${dir.views}"/>
<copy todir="${dir.intermediate}/${dir.views}" includeEmptyDirs="true">
<fileset dir="${dir.views}/" excludes="${file.default.exclude}, ${file.exclude}">
</fileset>
</copy>
<mkdir dir="${dir.publish}/${dir.views}"/>
<copy todir="${dir.publish}/${dir.views}" includeEmptyDirs="true">
<fileset dir="${dir.views}/" excludes="${file.default.exclude}, ${file.exclude}">
@ivoba
ivoba / install_silverstripe.sh
Created January 2, 2012 10:24 — forked from gherkins/install_silverstripe.sh
install silverstripe + common modules from github
# 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
@ivoba
ivoba / src.php
Created January 30, 2012 13:55
MongoDB integration in superleansilexplate
<?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();
@ivoba
ivoba / install_silverstripe.sh
Created February 8, 2012 12:24
silverstripe installer using submodules
# 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
@ivoba
ivoba / gist:2775277
Created May 23, 2012 13:40
AppKernel.php registerContainerConfiguration for config_local.yml
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);
}
@ivoba
ivoba / index.php
Created May 23, 2012 13:16
Tweaked Symfony2 bootstrap file
<?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' ) ){