Skip to content

Instantly share code, notes, and snippets.

View lsolesen's full-sized avatar

Lars Olesen lsolesen

View GitHub Profile
@lsolesen
lsolesen / phpunit.xml
Created December 10, 2010 18:42
phpunit.xml configuration attaching test listener
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true">
<listeners>
<listener class="TestListener" file="TestListener.php"></listener>
</listeners>
</phpunit>
@lsolesen
lsolesen / continious-integration.sh
Created December 14, 2010 08:01
run phpunit if git repos has been updated
#!/usr/bin/env bash
UPDATE=$(git pull origin master)
if [[ ${UPDATE} == "Updating*" ]]; then
cd /home/intraface_test/intraface-git/tests
phpunit --process-isolation --log-tap /home/intraface_test/test.intraface.dk/testresult . > /dev/null
cd /home/intraface_test
fi
@lsolesen
lsolesen / crontab
Created December 15, 2010 08:07
crontab entry
MAILTO=""
*/15 * * * * sh myscript.sh
@lsolesen
lsolesen / AuthController.php
Created January 4, 2011 15:46
Controller for the Zend Framework - making it testable?
<?php
/**
* This holds the auth controller class
*
* @package Insight
* @subpackage Controllers
*/
/**
* The auth controller class
@lsolesen
lsolesen / konstrukt.info
Created March 14, 2011 14:25
Proof of concept implementing konstrukt in Drupal 7
name = konstrukt
description = konstrukt
core = 7.x
@lsolesen
lsolesen / gist:870080
Created March 14, 2011 23:32
motionsplan_exercise_pdf.module
<?pdf
require_once 'fpdf.php';
class PDF_MC_Table extends FPDF
{
var $widths;
var $aligns;
var $imgs;
function SetWidths($w)
{
@lsolesen
lsolesen / MigrateNews.php
Created March 29, 2011 20:50
Migrate example for Drupal module migrate
<?php
class MigrateNews extends Migration {
public function __construct() {
parent::__construct();
$this->description = t('Migrate news from legacy database');
$this->team = array(
new MigrateTeamMember('Lars Olesen', '[email protected]', t('Webmaster')),
);
$query = db_select('nyhed', 'nyhed', array('target' => 'vih'))
->fields('nyhed', array('id', 'overskrift', 'tekst', 'date_created', 'date_updated', 'published'))
@lsolesen
lsolesen / my_module.info
Created April 1, 2011 08:56
Example on custom datetime filter for Views 3 for Drupal - see http://larsolesen.dk/node/273
core = "7.x"
name = "My Module"
description = "Example on how to add a filter handler with DATETIME"
package = "My modules"
php = "5.2.4"
project = "my_module"
version = "7.x-0.1"
files[] = "my_module_handler_filter_datetime.inc"
@lsolesen
lsolesen / gist:931386
Created April 20, 2011 13:53
mp_calc.module
<?php
/**
* Implementation of hook_filter_info().
*/
function mp_run_calc_filter_info() {
$filters['mp_run_calc_filter'] = array(
'title' => t('Motionsplan - Input filter to show forms in nodes'),
'description' => t('Substitutes [motionsplan:form_name] tags with the a form from the module.'),
'process callback' => 'mp_run_calc_filter_process',
'tips callback' => 'mp_run_calc_filter_tips',
@lsolesen
lsolesen / webwork_qa.markdown
Created May 3, 2011 19:34
Webwork observations

webwork observations

  • How does one set the worldwide template? - e.g. if you wanted to include webwork-authentic?

  • Where does one place a plugin? -- in vendor (that could be stated in the docs)

  • How to do the routing properly, so they are not overwritten on updates?

  • Maybe webwork core files should be in own repository, and the general directory setup etc. should be a scaffolding tool like krudt?

  • A little difficult to add a new page - you need both a handler and a route. Maybe there should be some standard routing, and then the possibility to create your own routing also.

  • Initial go on webwork at http://github.com/lsolesen/ghpages-manager