Skip to content

Instantly share code, notes, and snippets.

@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 / WikipediaMarkupCoordinates.php
Created December 20, 2011 09:21
parse Coordinates and convert to Lat/Lon from Wikipedia Markup
<?php
class WikipediaMarkupCoordinates{
/**
* @param string $text
* @return boolean|array
*
* bsp: http://de.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=Berufskolleg_Deutzer_Freiheit
*/
public static function parseCoordinatesFromInfobox($text) {
@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 / 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' ) ){
@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 / install_silverstripe3.sh
Created June 18, 2012 13:38
SilverStripe3 installer
#!/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:"