This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# grab the part of the repo url we want to display | |
svn_info() { | |
svn info 2> /dev/null | sed -n 's/^URL: svn:\/\/subversion\/symfony\/\(.*\)$/\1/p' | |
} | |
# Only echo if in an svn repo. | |
in_svn_repo() { | |
if [[ -d "./.svn" ]]; then | |
echo -e "\e[37;1mon \e[34;1m$(svn_info)" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For the colours in the sed replacement to work this is the only way I can get bash to interpret them correctly. | |
RED=`echo -e '\033[31m'` | |
GREEN=`echo -e '\033[32m'` | |
WHITE=`echo -e '\033[37m'` | |
# Nice simple coloured svn diff. | |
alias svndiff="svn diff | sed -e \"s/^\([+].*\)/$GREEN\1$WHITE/\" -e \"s/^\([-].*\)/$RED\1$WHITE/\""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# di=5;34;43 Setting the LS_COLORS di parameter to the above example will make directories appear in flashing blue text with an orange background | |
#0 = Default Colour | |
#1 = Bold | |
#4 = Underlined | |
#5 = Flashing Text | |
#7 = Reverse Field | |
#31 = Red | |
#32 = Green | |
#33 = Orange | |
#34 = Blue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$request = new HttpRequest('http://symfony/foo', HTTP_METH_PUT); | |
$request->setHeaders(array('Content-Type' => 'application/x-www-form-urlencoded')); | |
$request->setPutData('content=bar'); | |
$response = $request->send(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fuck nano | |
export EDITOR=vim | |
alias sst='svn st | grep -P --color=never "^(\W|\w)" | grep -vP "^(X|Perf)"' | |
alias sup="svn up" | |
alias sd="svn diff" | |
alias sci="svn ci" | |
alias sr="svn revert" | |
alias sa="svn add" | |
alias si="svn info" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function executeWebServiceCall() { | |
$client = new ServiceClient(new FooService(), new Http()); | |
$this->renderText($client->call()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ServiceClient { | |
private $service; | |
private $http; | |
public function __construct(Service $service, Http $http) { | |
$this->service = $service; | |
$this->http = $http; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ServiceClient { | |
private $service; | |
private $http; | |
private $logger; | |
public function __construct(Service $service, Http $http, sfLogger $logger) { | |
$this->service = $service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function executeWebServiceCall() { | |
$client = new ServiceClient(new FooService(), new Http(), $this->getLogger()); | |
$this->renderText($client->call()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ServiceClient implements SplSubject { | |
private $service; | |
private $http; | |
private $observers; | |
public function __construct(Service $service, Http $http) { | |
$this->service = $service; |
OlderNewer