Skip to content

Instantly share code, notes, and snippets.

View wolffc's full-sized avatar

Christian Wolff wolffc

  • Berlin, Germany
View GitHub Profile
@wolffc
wolffc / keybase.md
Created February 7, 2018 10:46
keybase.md

Keybase proof

I hereby claim:

  • I am wolffc on github.
  • I am cwolff (https://keybase.io/cwolff) on keybase.
  • I have a public key ASBDkkbdq0oQ8k4tf3-DRI7lZRLDrHUDcgMFXZm_pcn4jAo

To claim this, I am signing this object:

@wolffc
wolffc / delay.php
Last active December 5, 2017 13:54
Script to delay an http resource for debugging
<?php
namespace Aerticket\delay;
/**
* Script for Delaying Content Delivery for certain Resources
*/
/**
* Created by PhpStorm.
* User: cwolff
* Date: 05.12.2017
@wolffc
wolffc / perf_string_with_vars.php
Created October 14, 2015 10:34
Performance test of String Concattination in PHP
<?php
$testruns = 10000000;
$controllruns = 3;
$var = 12;
$var2 = 'bar';
$var3 = 'foo';
echo 'PHP Version: ' . phpversion() . PHP_EOL;
echo 'Operating System: ' . php_uname() . PHP_EOL;
@wolffc
wolffc / dublicate_files_md5.php
Last active August 29, 2015 14:21
find dublicate files in the current directory using md5 hashes
<?php
$data = array();
$directoryHandle = dir(__DIR__);
$path = $directoryHandle->path .'/';
while (false !== ($entry = $directoryHandle->read())) {
if(is_file($path.$entry) && substr($entry, 0) !== '.'){
$hash = md5_file($path.$entry);
$data[$hash][] = $path.$entry;
}
@wolffc
wolffc / extabase_in_controller_action_validation_example.php
Created May 7, 2015 07:34
This is an TYPO3 / Extbase Example on how to Validate some Properties in the Controller - this is usefull for conditonal Validation
<?php
class foo {
/**
* keep trac if we have created a custom error.
* @var boolean
*/
protected $hasCustomError = false;
@wolffc
wolffc / dump_database_and_reimport_as_utf8.sh
Created December 9, 2014 10:35
Exports a dump as latin1 and reimport it as utf8 (no convertsion done) this script is usefull if you have allready written utf-8 data to latin1 tables.
#!/bin/bash
## This script Converts the Typo3 Database to the Correct encoding
## by Exporting the database converting it and importing it agaion;
## CONFIGURATION:
DATE=$(date +"%Y%m%d%H%M")
FILENAME="temp_mysqldump_for_utf8conversion_$DATE.sql"
if [ -n "$1" ] || [-n "$2"]
then
echo "Create dump"
@wolffc
wolffc / t3x-convert-character-set-to-utf8.sh
Created December 9, 2014 10:31
Convert an typo3 database to utf-8
#!/bin/bash
#
# Creates a backup of a database in mirgrates every table to UTF-8 Including Collation
# written by christian Wolff cwolff@aer.de
## Configuration
DB_USER=$1
DB_PASS=$2
DB_NAME=$3
@wolffc
wolffc / .gitconfig
Created October 17, 2013 15:03
git Config
[gui]
[user]
name = Christian Wolff
email = chris@connye.com
[gui]
encoding = utf-8
[core]
excludesfile = ~/.gitignore_global
[alias]
@wolffc
wolffc / sublimeText 3 Packages.md
Last active August 22, 2020 04:39
Sublime Text 3 Packages I Use
@wolffc
wolffc / split_sql.php
Created June 27, 2013 09:30
SQL File Splitter class
<?php
/**
* SQL Splitter class
* for splitting SQL dumps into multiple files for better upload to webfrontends like
* phpMyAdmin
* author: christian Wolff
*/
class sqlSplit{
/**
* The preg Condtion used vor detecting splitable lines. we dont want to split between an multilien STatement