Skip to content

Instantly share code, notes, and snippets.

@kraftb
kraftb / rewrite-staticfilecache.conf
Created August 16, 2018 14:07
TYPO3 EXT:static_file_cache Apache Config file
######################################################################
# Copyright notice
#
# (c) 2013-2018 webconsulting business services gmbh (office@webconsulting.at)
# All rights reserved
#
# Based on work of various TYPO3 authors.
#
# This script is part of the TYPO3 project. The TYPO3 project is
#!/usr/bin/php
<?php
// generateGettersAndSetters.php
//
// (c) 2017: kraftb@think-open.at
// Version: 1.0
$getterTemplate = '
/**
@kraftb
kraftb / temp.php
Created May 22, 2015 19:59
Read out temperature from an LM75 via Arduino as I2C adapter
#!/usr/bin/php
<?php
define('CHAR_ERROR', chr(0x1B)); // <ESC>
define('CHAR_ESCAPE', chr(0x5C)); // '\'
define('CHAR_ESCAPED_ERROR', chr(0xB1));
define('CHAR_ESCAPED_ESCAPE', chr(0xC5));
define('LM75_ADDR', 0x48);
@kraftb
kraftb / I2C_Adapter.ino
Created May 19, 2015 15:31
USB to I2C Adapter using Arduino
// I2C to USB Adapter using Arduino
// by Bernhard Kraft <kraftb@think-open.at>
/**
* This sketch can get loaded onto an Arduino to use it as USB to I2C Adapter.
* It uses the Wire library. So take a look at the documentation of the Wire
* libarary about the pins being used as SDA/SCL. For most Arduino boards this
* will be analog input pin 4 for SDA and analog input pin 5 for SCL.
*
* On the USB side the default serial link of the Arduino is used. A protocol
@kraftb
kraftb / PATCH_perf-ext.diff
Created May 10, 2015 08:37
ext2 performance improvement: ext2_statfs
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 9f9992b..c7bb6d2 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -1520,17 +1520,3 @@ int ext2_bg_has_super(struct super_block *sb, int group)
return 1;
}
-/**
- * ext2_bg_num_gdb - number of blocks used by the group table in group
@kraftb
kraftb / Makefile
Created March 18, 2015 06:42
Makefile for gEDA projects (gschem, pcb)
SCHEMATICS=tom-alexandria-1.sch tom-alexandria-2.sch tom-alexandria-3.sch tom-alexandria-4.sch
TARGET=tom-alexandria
all: $(TARGET).drc
gsch2pcb -o $(TARGET) $(SCHEMATICS)
edit-schematic:
gschem $(SCHEMATICS)
@kraftb
kraftb / README.md
Last active August 22, 2017 19:59
Script for opening a mysqlshell by passing it the path to a TYPO3 instance

Script for opening a mysql shell to TYPO3

This script allows to easily open a mysql shell to the database being used by a TYPO3 instance. Simply install this script in any executable path like $HOME/bin.

Then "cd" to a TYPO3 webroot and there type (possibly using bash shell expansion):

@kraftb
kraftb / README.md
Last active October 19, 2022 14:25
Completely clear the cache of a TYPO3 instance (filesystem, database)

Script for clearing all TYPO3 caches

This script aims to clear all (yes. really all) caches being used by TYPO3. So the file caches in typo3temp and typo3conf/autoload, next the database caches in tables cf_* and eventual realurl caches. And finally any PHP caches like those from APC, xcache, or other PHP accelerators/compilers.

Simply install the script at some executable location on your webserver

t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Crossport setup');
if (TYPO3_MODE === 'BE') {
/**
* Registers a Backend Module
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'ThinkopenAt.' . $_EXTKEY,
'user', // Make module a submodule of 'user'
@kraftb
kraftb / gist:96e060bcf1c58f647594
Created June 17, 2014 14:48
HOWTO: Extend TYPO3/extbase Model with new fields
1. Create ext_tables.sql and add new fields as usual
2. Create Configuration/TCA/Overrides/tablename.php and extend TCA therein (before: ext_tables.php)
3. Add the following lines to your ext_localconf.php. Where the first argument of "registerImplementation" is the model class you would like to extend and the second argument is your own implementation.
$extbaseObjectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\Container\\Container');
$extbaseObjectContainer->registerImplementation('Tx_News_Domain_Model_NewsDefault', 'thinkopen_at\T3ff\Domain\Model\NewsT3ff');
4. Create your own implementation of the mode class and add the new properties + getters/setters for them