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
program raw; | |
{ | |
TechEmpower framework benchmarks implementation | |
See https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview | |
} | |
{$I mormot.defines.inc} | |
{.$define USE_SQLITE3} |
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
{ procedure PULSEWAY } | |
procedure TForm1.Button1Click(Sender: TObject); | |
var | |
Json: string; | |
LResponse: string; | |
JsonToSend: TStringStream; | |
begin | |
Json := '{"instance_id": "' + 'rest-v2' + | |
'","title": "' + 'MyTitle' + |
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
# ProcessWire Wireshell bash alias | |
# grab and install the latest ProcessWire development version from the latest commit | |
alias pwnew='wireshell new --sha=`git ls-remote https://github.com/processwire/processwire refs/heads/dev | cut -f1`' | |
# upgrade to the latest ProcessWire development version from the latest commit | |
alias pwup='wireshell upgrade --sha=`git ls-remote https://github.com/processwire/processwire refs/heads/dev | cut -f1`' |
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
/** | |
* Hook : place this hook in admin.php | |
* | |
* Add FieldtypeDecimal to compatible fieldtypes of | |
* a FieldtypeFloat when a superuser need to change the type | |
* of a float field. | |
* | |
* https://modules.processwire.com/modules/fieldtype-decimal/ | |
* https://processwire.com/talk/topic/7542-development-fieldtypefloat-fieldtypedecimal/ | |
* |
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 | |
class FacebookLike extends WireData implements Module { | |
public static function getModuleInfo() { | |
return array( | |
'title' => 'Facebook Like Button', | |
'version' => 101, | |
'summary' => 'Display Facebook like buttons on your Processwire site.', |
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 namespace ProcessWire; | |
class LikeSystem extends WireData implements Module { | |
const minVersion = '3.0.0'; | |
protected $tableName = 'likes_system'; | |
public static function getModuleInfo() | |
{ |
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 | |
// debug function | |
function debug ($data) { | |
echo "<script>\r\n//<![CDATA[\r\nif(!console){var console={log:function(){}}}"; | |
$output = explode("\n", print_r($data, true)); | |
foreach ($output as $line) { | |
if (trim($line)) { | |
$line = addslashes($line); | |
echo "console.log(\"{$line}\");"; | |
} |
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 namespace ProcessWire; | |
/* | |
* https://processwire.com/talk/topic/14133-displaying-code-snippets-on-the-front-end-with-ckeditor/ | |
* | |
* exemple working with highlightJS (https://highlightjs.org/) | |
* Howto: | |
* - include highlightjs css: <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css"> | |
* - javascript: <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script> | |
* - write the following code in your main js script file eg: main.js |
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
// [...] | |
$field = $this->modules->get("InputfieldFile"); // dummy field | |
$field->attr("name+id", 'photo'); | |
$form->add($field); | |
// DO NOT TRUST $_FILES['photo']['mime'] VALUE !! | |
// Check MIME Type by yourself. | |
$finfo = new \finfo(FILEINFO_MIME_TYPE); |