Skip to content

Instantly share code, notes, and snippets.

View SS4_lemp_config.conf
server {
listen 80;
# server_name domain.tld www.domain.tld;
index index.php;
root /var/www/current;
charset utf8;
autoindex off;
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@ivoba
ivoba / gist:faf0cff10410024f87e0
Created Jun 17, 2015
VarDumper dump javascript error #15015
View gist:faf0cff10410024f87e0
<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 / Dockerfile
Created Feb 20, 2015
php5.5 with pimple c extension
View Dockerfile
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 / post-merge
Created Nov 13, 2014
post-merge hook for composer php apps
View post-merge
#/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"
}
@ivoba
ivoba / app.js
Last active Dec 26, 2015
bower & masonry & imagesloaded & requirejs
View app.js
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
});
View MemberProfileFieldExtension.php
<?php
class MemberProfileFieldExtension extends DataExtension {
public static $db = array(
'SortOrder' => 'Int'
);
function updateCMSFields(FieldList $fields) {
$fields->push(new NumericField('SortOrder', 'SortOrder'));
@ivoba
ivoba / IndexController.php
Created Jul 30, 2012
Symfony2 caching with LiipDoctrineCacheBundle
View IndexController.php
$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
}
@ivoba
ivoba / IndexController.php
Created Jul 10, 2012
symfony2 caching data via doctrine/commons
View IndexController.php
$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
}
@ivoba
ivoba / install_silverstripe3.sh
Created Jun 18, 2012
SilverStripe3 installer
View install_silverstripe3.sh
#!/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:"
You can’t perform that action at this time.