Skip to content

Instantly share code, notes, and snippets.

View chillu's full-sized avatar
👋

Ingo Schommer chillu

👋
View GitHub Profile
@chillu
chillu / bench.sh
Last active December 14, 2015 21:28
#/bin/bash
# Compares response times on a specific URL on different SilverStripe versions.
#
# USAGE: bench.sh <base-path> <base-url>
basepath=$1
baseurl=$2
urls="/?flush=all /"
abparams="-n 10"
@chillu
chillu / - howto-travis-silverstripe.md
Last active December 15, 2015 12:48
Howto: Continuous Integration for SilverStripe Modules with Travis and Composer
class NewsPage extends Page {
static $db = array(
'SidebarTextAboveImage' => 'Text',
'SidebarTextBelowImage' => 'Text',
);
static $has_one = array(
'SidebarImage' => 'Image'
);
}
<?php
class WidgetArea extends DataObject {
static $belongs_many_many = array(
'Pages' => 'Page'
);
static $many_many_extraFields = array(
'Pages' => array(
'SectionName' => 'Varchar'
)
);
commit 62d1b23eabb185616015d786990a7f82f042777f
Author: a2nt <tony@thewebdevelopmentagency.com>
Date: Sat May 4 04:45:53 2013 +0700
IMPROVEMENT Media Dialog extra data
HtmlEditorField_Toolbar class allows you to extend media fields for an
instance this way:
[code]
class HtmlEditorField_ToolbarEx extends Extension {
commit d47b2026971d74cb9604a27edb6aa905499f132f
Author: Jeremy Shipman <jeremy@burnbright.net>
Date: Fri Apr 19 15:45:43 2013 +1200
Restored c4eac5310e1f (merge error)
FIX: Instead of CsvBulkLoader->findExistingRecord out right failing (i.e. no duplicate found) when the duplicate check field is empty, it will now continue on to check other duplicateCheck fields.
Added extra testing data to CSVBulkLoaderTest so that it fails.
diff --git a/dev/CsvBulkLoader.php b/dev/CsvBulkLoader.php
@chillu
chillu / Gruntfile.js
Last active December 19, 2015 09:09
Grunticon support in SS.
/*jshint node:true*/
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
grunticon: {
mobileIcons: {
options: {
@chillu
chillu / list_gitorious_repos.py
Last active October 18, 2019 07:38
Python script to list all repos for gitorious projects. Since this feature is not available through the UI, we need to use the provided XML data as a start to aggregate these results. Requires Python 3. Example usage: python3.3 list_gitorious_repos.py -u myuser@test.com -p mypassword --repo cms http://gitorious.silverstripe.com
import argparse
import xml.etree.ElementTree as ET
import urllib.request
import base64
import json
import os.path
import re
class GitoriousRepoLister:
"""
@chillu
chillu / search.feature
Created November 15, 2013 13:48
Blog example: Search feature
Scenario: I can search for a page by its newest last edited date
Given a "page" "Recent Page"
And a "page" "Old Page" was last edited "7 days ago"
When I fill in "To" with "the date of 5 days ago"
And I press the "Apply Filter" button
Then I should not see "Recent Page" in the tree
But I should see "Old Page" in the tree
<?php
use Behat\Behat\Context\BehatContext;
class MyFeatureContext extends BehatContext {
protected $dateFormat = 'Y-m-d';
/**
* Transforms relative date statements compatible with strtotime().
* Example: "date 2 days ago" might return "2013-10-10" if its currently