Skip to content

Instantly share code, notes, and snippets.

View alpacaaa's full-sized avatar
🎱
Testing in production

Marco Sampellegrini alpacaaa

🎱
Testing in production
View GitHub Profile
public function customDBMS($context)
{
$fieldName = 'changeMe'; // change this to your checkbox field name
$event = $context['event'];
$section = $event->getSource();
require_once(TOOLKIT . '/class.sectionmanager.php');
if (!$this->sectionManager)
$this->sectionManager = new SectionManager($context['parent']);
<?php
// put inside extensions/members_openid
class Extension_Members_Openid extends Extension{
public function about(){
return array('name' => 'Members with OpenID',
'version' => '0.1',
'release-date' => '2011-03-13',
'author' => array('name' => 'Marco Sampellegrini',
<?php
// file extensions/resave_entries/extension.driver.php
class extension_resave_entries extends Extension
{
public function about()
{
return array(
'name' => 'Resave entries',
'version' => '0.1',
<student_list>
<student>
<name>George Washington</name>
<major>Politics</major>
<phone>312-123-4567</phone>
<email>gw@example.edu</email>
</student>
<student>
<name>adabadaje Jones</name>
<major>Undeclared</major>
<data>
<upcoming-events>
<section id="15" handle="upcoming-events">Upcoming events</section>
<entry id="1037">
<title handle="brockwell-park-firework-display-saturday-5th-november">BROCKWELL PARK FIREWORK DISPLAY - Saturday 5th November</title>
<date time="18:12" weekday="6">2011-11-05</date>
<time handle="700-745pm">7.00-7.45pm</time>
<location handle="outside-brockwell-hall-brockwell-park">Outside Brockwell Hall, Brockwell Park</location>
<content>Due to our MASSIVE successes at the Lambeth Country Show and the car-free days, Lambeth Events team have asked us to sing before the Firework Display in Brockwell Park. Wrap up warm in your Popchoir Sweatshirt and come along with your family and friends to enjoy the funfair and the fireworks as well as our own performance! And yes - they've learned their lesson - there WILL be a PA system this time!!!</content>
<choirs>
<data>
<hello>paste your xml here</hello>
</data>
wwwww aaaaaaahh!!!
@alpacaaa
alpacaaa / mapping.php
Created May 10, 2012 14:52
Mapping of xslt Utilies imported in xpathr.com
<?php
array (
0 => array('gist' => '2653475', 'id' => '79266'),
1 => array('gist' => '2653476', 'id' => '78502'),
2 => array('gist' => '2653477', 'id' => '37740'),
3 => array('gist' => '2653478', 'id' => '38065'),
4 => array('gist' => '2653479', 'id' => '83467'),
5 => array('gist' => '2653481', 'id' => '20482'),
6 => array('gist' => '2653482', 'id' => '54294'),
7 => array('gist' => '2653484', 'id' => '76976'),
<?xml version="1.0" encoding="utf-8" ?>
<data>
<params>
<root>http://www.example.com</root>
<view />
</params>
<projectpreviews>
<section id="1" handle="projects">Projects</section>
<entry id="2">
<project-name handle="sample-project-2">Sample Project 2</project-name>
@alpacaaa
alpacaaa / ROADMAP.markdown
Created December 10, 2012 19:21
xpathr plan

xpathr – first iteration

In this first iteration, unauthenticated users should be able to test xslt code, save snippets and eventually come back to edit them without signing up. xpathr will work without javascript enabled, so client side code shouldn't be taken in consideration for now.

UI:

  • XML textarea
  • XSL textarea
  • RESULT read-only textarea