(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| DELIMITER | | |
| CREATE FUNCTION uuid_from_bin(b BINARY(16)) | |
| RETURNS CHAR(36) DETERMINISTIC | |
| BEGIN | |
| DECLARE hex CHAR(32); | |
| SET hex = HEX(b); | |
| RETURN CONCAT(LEFT(hex, 8), '-', MID(hex, 9,4), '-', MID(hex, 13,4), '-', MID(hex, 17,4), '-', RIGHT(hex, 12)); | |
| END | |
| | |
| $ git branch -r --merged | | |
| awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | | |
| xargs git push origin --delete |
| <!-- | |
| Ant target for autogenerating a changelog based on Git tags | |
| Workflow: | |
| 1. Do all of your checkins for a given version. | |
| 2. When you're ready to officially create a new version, tag it using git tag, such as "git tag v0.3.0". | |
| 3. If you don't already have a file named CHANGELOG in the root directory, make one. | |
| 4. Run "ant changelog.update" |
| <?php | |
| class LCSTest extends PHPUnit_Framework_TestCase | |
| { | |
| /** | |
| * Returns the longest common subsequence of two arrays. | |
| * | |
| * @link http://en.wikipedia.org/wiki/Longest_common_subsequence_problem | |
| * | |
| * @param array $left The first array. |
| <?php | |
| use Liip\FunctionalTestBundle\Test\WebTestCase; | |
| use Symfony\Component\HttpKernel\Profiler\Profiler; | |
| use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; | |
| use Symfony\Component\Security\Core\User\UserInterface; | |
| /** | |
| * @group functional | |
| */ |
| server { | |
| listen 80; | |
| server_name localhost; | |
| root /home/website/web; | |
| rewrite ^/app\.php/?(.*)$ /$1 permanent; | |
| try_files $uri @rewriteapp; | |
| location @rewriteapp { |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
| <?php | |
| class ReconnectingPDO | |
| { | |
| protected $dsn, $username, $password, $pdo, $driver_options; | |
| public function __construct($dsn, $username = "", $password = "", $driver_options = array()) | |
| { | |
| $this->dsn = $dsn; | |
| $this->username = $username; | |
| $this->password = $password; |
We are working on a framework, is mandatory that you have read the framework doc: