Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
# ~/code/web:beta_directory$ git checkout master | |
# Switched to branch "master" | |
# ~/code/web:master$ git checkout beta_directory | |
# Switched to branch "beta_directory" |
<?php | |
/* | |
KOIVI HTML Form to FDF Parser for PHP (C) 2004 Justin Koivisto | |
Version 1.1 | |
Last Modified: 2010-02-17 | |
This library is free software; you can redistribute it and/or modify it | |
under the terms of the GNU Lesser General Public License as published by | |
the Free Software Foundation; either version 2.1 of the License, or (at | |
your option) any later version. |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php | |
/** | |
* Copyright (c) 2007, Roger Veciana | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* Redistributions of source code must retain the above copyright notice, this |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
// /app/Event/BlogEventListener.php | |
<?php | |
App::uses('CakeEventListener', 'Event'); | |
class BlogEventListener implements CakeEventListener { | |
public function implementedEvents() { | |
return array( | |
'Controller.Blog.afterAdd' => 'myEventFunction', // assign event to function | |
); |
Just came across this scenerio... word-wrap on table td's don't work the work around for this is adding a wraper div and then applying word-wrap:break-word on it. But then this is not a semantic solution whichc adds extra divs around content.
Another work around is adding table-layout:fixed on the main table and then addding word-wrap:break-word on td's.
adsfdsafsdfsadfsdafsadfsdEnable tracing example: | |
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so" | |
xdebug.auto_trace=1 | |
xdebug.trace_output_dir="/tmp/xdebug/" | |
xdebug.collect_params=4 | |
xdebug.collect_return=1 | |
xdebug.trace_options=1 | |
xdebug.show_local_vars=1 |
<?php | |
/** | |
* This class can add WSSecurity authentication support to SOAP clients | |
* implemented with the PHP 5 SOAP extension. | |
* | |
* It extends the PHP 5 SOAP client support to add the necessary XML tags to | |
* the SOAP client requests in order to authenticate on behalf of a given | |
* user with a given password. | |
* |
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |