Skip to content

Instantly share code, notes, and snippets.

View garvinhicking's full-sized avatar

Garvin Hicking garvinhicking

View GitHub Profile
CREATE TABLE serendipity_spamblocklog (
timestamp int(10) default null,
type varchar(255),
reason text,
entry_id int(10) not null default '0',
author varchar(80),
email varchar(200),
url varchar(200),
useragent varchar(255),
ip varchar(15),
@garvinhicking
garvinhicking / gist:7823333
Created December 6, 2013 12:57
Quick and dirty IMDB comparison
<?php
$myself = 'garvin';
$compare = 'andih';
# Usage:
# - wget a URL like this:
# http://www.imdb.com/list/export?list_id=ratings&author_id=ur0555872 (garvin)
# - save it as imdb_ratings_XXX.csv (see below when it gets called)
# - do the same with the CSV of the second user you want to compare with
# - enter the proper user names/file names at the bottom of this file
-@define('STATICPAGE_PAGEADD_DESC', 'Wählen Sie die Plugins aus, die in der staticpage sidebar als Link zur Verfügung stehen sollen.');
+@define('STATICPAGE_PAGEADD_DESC', 'Wählen Sie die Plugins aus, die in der Frontend Seitenleiste als zusätzlicher "Staticpage"-Link zur Verfügung stehen sollen.');
-?>
-<br />
+<!-- DEFAULT_STATICPAGE_BACKEND.TPL start -->
- <label class="sp_label" title="{staticpage_input item="headline" what="desc"|escape:js}">{staticpage_input item="headline" what="name"|escape:js}</label><br />
+ <label class="sp_label" title="{staticpage_input item="headline" what="desc"}">{staticpage_input item="headline" what="name"}</label>
- <label class="sp_label" title="{staticpage_input item="articleformattitle" what="desc"|escape:js}">{staticpage_input item="articleformattitle" what="name"|escape:js}</label><br />
+ <label class="sp_label" title="{staticpage_input item="articleformattitle" what="de
+4.10 Fixed (4.06) markup and sets (4.06 listentries) to be optional (selectbox default) due to errors
+ Added some css
+ Fixed some minor markup errors
+ Fixed backend_templates/default_staticpage_backend.tpl smarty markup (escape and cke-wysiwyg)
+ Changed Template names
+ Added 'publishstatus' and removed 'pass','is_startpage','is_404_page' in plugins config options,
+ since the latter were unused there and are too specific to be set global in plugin config.
+ Now 'publishstatus' will respect a global show as option rule (Draft is default)
+ Outsourced some heavy markup functions
+ Smartified the backend as much as possible (get ready to run smarty-only in future?)
function mystify(&$handler, $newhandler) {
$regex = '@(\w+)="([^"]+)"@imsU';
preg_match($regex, $newhandler, $newhandlerpart);
$new = array();
$has_handle = false;
if (preg_match_all($regex, $handler, $handlerparts)) {
foreach($handlerparts[1] AS $idx => $handle) {
if ($handle == $newhandlerpart[1]) {
$has_handle = true;
@garvinhicking
garvinhicking / gist:5aa581920139f4847d59
Created January 29, 2015 12:44
Serendipity iframe-less preview patch
diff --git a/include/functions_config.inc.php b/include/functions_config.inc.php
index ca0dfb6..e6a615e 100644
--- a/include/functions_config.inc.php
+++ b/include/functions_config.inc.php
@@ -826,7 +826,12 @@ function serendipity_iframe(&$entry, $mode = null) {
case 'preview':
$serendipity['smarty_preview'] = true;
- $data['preview'] = serendipity_printEntries(array($entry), ($entry['extended'] != '' ? 1 : 0), true);
+
Inzwischen sind uns einige "Quirks" aber gerade in
Corona-Hardcore-Shopping-Zeiten so negativ aufgefallen, dass wir nicht
wirklich produktiv mit Bring "arbeiten" können.
Unser Hauptproblem ist die Sortierung bzw. Verteilung der Artikel auf
Listen.
Wir fanden es nie praktikabel, die Einkäufe nach Läden zu gruppieren,
weil man beim Hinzufügen von Artikeln ja nicht daran denkt, wo man die
holt, sondern was man braucht. Wenn man also sagt:
@garvinhicking
garvinhicking / gist:1fec91c39d4a42d607578d157fb725d3
Created February 10, 2023 08:49
InfluxDB stacked bar flux query tasmota watt
import "strings"
from(bucket: "homeassistant")
// Range is set MANUALLY! Currently it's daily for a month, but you could change it to -1y here!
|> range(start: -30d)
// That's the MQTT measurement my devices use, YMMV
|> filter(fn: (r) => r["_measurement"] == "tasmota")
// That's the Tasmota field "Total". Should be the same for anyone.
|> filter(fn: (r) => r["_field"] == "Total")
// Make sensor names readable. Mine get stored as "tele/tasmota_office" for example, and I only want to get "office". Change strings to your setup.
|> map(fn: (r) => ({ r with topic: strings.replaceAll(v: strings.replaceAll(v: r.topic, t:"/SENSOR", u:""), t:"tele/tasmota_", u:"") }))
@garvinhicking
garvinhicking / t3d.php
Created October 9, 2023 13:32
TYPO3 T3D uncompress / extract / deflate / extrahieren / entpacken
<?php
# Execute:
# php -d memory_limit=2G t3d.php file.t3d > output.txt
$fd = fopen($argv[1], 'rb');
function getNextFilePart($fd, $unserialize = false, $name = '') {
$headerLength = 32 + 1 + 1 + 1 + 10 + 1;
$headerString = fread($fd, $headerLength);
if (empty($headerString)) {
echo 'File does not contain data for "' . $name . '"';
@garvinhicking
garvinhicking / ReferenceIndex.php.diff
Last active October 15, 2023 19:16
ReferenceIndex Post-Patch
diff --git a/typo3/sysext/core/Classes/Database/ReferenceIndex.php b/typo3/sysext/core/Classes/Database/ReferenceIndex.php
index a5ea028d9c..39c8998f55 100644
--- a/typo3/sysext/core/Classes/Database/ReferenceIndex.php
+++ b/typo3/sysext/core/Classes/Database/ReferenceIndex.php
@@ -981,6 +981,11 @@ class ReferenceIndex
if ($numberOfDeletedRecordsInTargetTable > 0) {
$numberOfHandledRecords += $numberOfDeletedRecordsInTargetTable;
// List of deleted=0 records in target table that have records in sys_refindex.
+ // Note: $subQueryBuilder actually fills parameter placeholders for the main $queryBuilder
+ // That means the subQuery is never meant to be executed on its own, only used to be filled-in