Using a new updatable chart format. Update functions are made accessible to the caller, handing over chart controls with full functionality to the caller in a modular manner. Data binding is done with method chaining, like any other configuration variable, and can be changed after initialization. This allows for changes to be rendered in the context of chart history, leveraging D3's transitions and update logic.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
// Based on article @ http://www.toptal.com/d3-js/towards-reusable-d3-js-charts | |
// Publish a factory method for Chart instances | |
// @usage: | |
// var runningChart = BarChart.instanceOf( {barPadding : 2 } ); | |
// var weatherChart = BarChart.instanceOf() | |
// .fillColor('coral'); | |
window.BarChart = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// I made this array by joining all the following lists + .php extension which is missing in all of them. | |
// please contribute to this list to make it as accurate and complete as possible. | |
// https://gist.github.com/plasticbrain/3887245 | |
// http://pastie.org/5668002 | |
// http://pastebin.com/iuTy6K6d | |
// total: 1223 extensions as of 16 November 2015 | |
$mime_types = array( | |
'3dm' => array('x-world/x-3dmf'), | |
'3dmf' => array('x-world/x-3dmf'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Remote File Copy PHP Script 2.0.0 | |
* | |
* Copyright 2012, Sebastian Tschan | |
* https://blueimp.net | |
* | |
* Licensed under the MIT license: | |
* http://www.opensource.org/licenses/MIT | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// source: https://processwire.com/talk/topic/680-multiple-sites-from-one-install/?p=8778 | |
class Multisite extends WireData implements Module, ConfigurableModule { | |
public static function getModuleInfo() { | |
return array( | |
'title' => 'Multisite', | |
'version' => 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adding other types of save buttons for page edit form. | |
* | |
* ProcessWire 2.x | |
* Copyright (C) 2010 by Ryan Cramer | |
* Licensed under GNU/GPL v2, see LICENSE.TXT | |
* | |
* http://www.processwire.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Script: DataTables server-side script for PHP and MySQL | |
* Copyright: 2012 - John Becker, Beckersoft, Inc. | |
* Copyright: 2010 - Allan Jardine | |
* License: GPL v2 or BSD (3-point) | |
*/ | |
class TableData { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Bootstrap ProcessWire | |
require 'index.php'; | |
// Make sure that FieldtypeRepeater is installed and ready for use | |
if (!wire('modules')->isInstalled('FieldtypeRepeater')) { | |
if (wire('modules')->isInstallable('FieldtypeRepeater')) { | |
wire('modules')->install('FieldtypeRepeater'); | |
echo "Module FieldtypeRepeater installed\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// stripped down code | |
$old_name = 'lizard.jpg'; | |
$new_name = 'wizard'; | |
$p = $pages->find("image.data=$old_name")->first(); | |
$p->of(false); // outputformatting off, single and multiple image fields are from now on wire array's |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* creates a compressed zip file */ | |
function create_zip($files = array(),$destination = '',$overwrite = false) { | |
if(file_exists($destination) && !$overwrite) { return false; } | |
if(is_array($files)) { | |
foreach($files as $name => $file) { | |
if(!file_exists($file)) unset($files[$name]); | |
} | |
} |