Skip to content

Instantly share code, notes, and snippets.

@tamboer
tamboer / LAMP-after-installation.txt
Created April 18, 2014 08:19
LAMP things to do after installation
After the lamp server installation you will need write permissions to the /var/www directory. Follow these steps to configure permissions.
Add your user to the www-data group
sudo usermod -a -G www-data <your user name>
now add the /var/www folder to the www-data group
sudo chgrp -R www-data /var/www
@tamboer
tamboer / drupal-theme.txt
Created April 3, 2014 09:04
Drupal-theme
https://drupal.org/node/104319
Theming blocks individually, by region, or by module
Last updated May 22, 2013. Created by joachim on December 20, 2006.
Edited by batigolix, Delphine Lepers, jamix, chrisjlee. Log in to edit this page.
Designers can create multiple tpl.php files for blocks based on the specific block, the module that created the block, or the region that the block appears in.
Template suggestions
@tamboer
tamboer / mac-settings.txt
Created April 1, 2014 18:00
Mac Settings
defaults write com.apple.finder AppleShowAllFiles -bool YES
@tamboer
tamboer / drupal_cache
Created March 31, 2014 10:14
Drupal cache
drush vset cache 0
drush vset preprocess_css 0
drush vset preprocess_js 0
@tamboer
tamboer / php-mail-test
Created February 20, 2014 15:11
php mail test
<?php
$buyer_email = "";
//$buyer_email = "";
$supplier_email = "";
$supplier_email2 = '';
$lastInsertedID = 'mailtest from bewan with PDF';
$orderArray['order_date'] = '2014';
$pdfdoc = file_get_contents('yourfilename.pdf');
@tamboer
tamboer / colours.css
Created February 13, 2014 09:58
css colours
/*reds*/
.IndianRed { background: #CD5C5C;}
.LightCoral { background: #F08080;}
.Salmon { background: #FA8072;}
.DarkSalmon { background: #E9967A;}
.LightSalmon { background: #FFA07A;}
.Crimson { background: #DC143C;}
.Red { background: #FF0000;}
@tamboer
tamboer / ZF_flashMessenger_example.php
Last active January 3, 2016 11:38
ZF FlashMessenger example
<?php
class TestController extends Zend_Controller_Action {
/**
* FlashMessenger
*
* @var Zend_Controller_Action_Helper_FlashMessenger
*/
protected $_flashMessenger = null;
@tamboer
tamboer / CrudController.php
Last active January 3, 2016 11:29
ZF CRUD controller
<?php
class Controller_Base_Crud extends Zend_Controller_Action {
/**
* An instance of the corresponding Service layer
* @var object
*/
protected $_service = null;
@tamboer
tamboer / check_VAT_number.php
Last active December 31, 2015 22:49
check VAT number
<?php
class Helper {
/**
* http://www.pfz.nl/wiki/invoer-validatie/#Geldig_BTW.2FVAT_nummer
*
* Look if the given input could be a legal VAT-number.
* Accepts input with or without '.' between the numbers, must contain a County-code
*
@tamboer
tamboer / daynumber.php
Created November 7, 2013 12:11
week day to number or visa versa
<?php
function dayToNumber($day) {
$array = array('Mon' => 1, 'Tue' => 2, 'Wed' => 3, 'Thu' => 4, 'Fri' => 5, 'Sat' => 6, 'Sun' => 7);
$result = $array[$day];
return $result;
}
function numberToDay($number) {
$array = array(1 => 'Mon', 2 => 'Tue', 3 => 'Wed', 4 => 'Thu', 5 => 'Fri', 6 => 'Sat', 7 => 'Sun');