Skip to content

Instantly share code, notes, and snippets.

@rowild
rowild / flatten.php
Last active August 30, 2015 06:55 — forked from kohnmd/flatten.php
Function to recursively flatten multidimensional PHP array.
<?php
// Requires PHP 5.3+
// Found here: http://stackoverflow.com/a/1320156
function flatten_array(array $array) {
$flattened_array = array();
array_walk_recursive($array, function($a) use (&$flattened_array) { $flattened_array[] = $a; });
return $flattened_array;
}
@rowild
rowild / Install_latest_xdebug_for_MAMP.md
Last active March 9, 2020 17:28
Install latest XDebug for MAMP php versions

Install latest XDebug for MAMP php

The installation of XDebug requires some additional steps to make it work:

  1. Change the local bash files to address the MAMP version of php.
  2. Download the same version of php that you want to use within MAMP from php.net and build it manually.
  3. Download XDebug and follow the installation instructions as provided by the XDebug website.

Step-by-step guide:

1. Adjust the bash files to address the MAMP php version

@rowild
rowild / typo3_felogin_redirect_to_previousely_visited_page.php
Last active August 29, 2015 14:19
TYPO3 - felogin -> redirect to previousely visited page
<?php
// From: Newslist en - 25.4.2014
// http://wiki.typo3.org/Felogin#Users_manual
// Add this line in my ext_localconf:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_confirmed'][] = 'tx_myextension->myfunction';
// And in my class extension:
class tx_myextension extends {
public function myfunction() {
/************************
* Vars
***********************/
// standard default browser font size is 16px
$base_font_size = 16
// bring the base font size upto 18px while respecting the client's individual browser setting
$base_font_size_ems = unit($base_font_size / 16, em)
@rowild
rowild / css_image_replacement_expl.css
Last active December 16, 2015 23:49
CSS: Image Replacement
/* Text hiding without indent */
.ir {
border: 0;
font: 0/0 a;
text-shadow:none;
color: transparent;
background-color: transparent;
}