These commands are good as of 2011-07-27.
App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.
<?php | |
// Inside your action | |
$this->serializer = new \Symfony\Component\Serializer\Serializer(); | |
$this->serializer->addNormalizer(new \Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer()); | |
$this->serializer->setEncoder('xml', new \Symfony\Component\Serializer\Encoder\XmlEncoder()); | |
return $this->createResponse($this->serializer->encode($page, 'xml'), 200, array('Content-Type' => 'application/xml')); |
<?php | |
/** | |
* Just trying out more functional programming in PHP | |
* This gist provides some basic utility functions for: | |
* + Working with functions | |
* + Working with arrays | |
*/ | |
// This function allows creating a new function from two functions passed into it | |
function compose(&$f, &$g) { |
$ git branch -r --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
These commands are good as of 2011-07-27.
App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.
<?php | |
/** | |
* Copyright © 2011 Erin Millard | |
*/ | |
/** | |
* Returns the number of available CPU cores | |
* | |
* Should work for Linux, Windows, Mac & BSD |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
--- | |
#### | |
#### THIS IS OLD AND OUTDATED | |
#### LIKE, ANSIBLE 1.0 OLD. | |
#### | |
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES | |
#### | |
#### IF IT BREAKS I'M JUST SOME GUY WITH | |
#### A DOG, OK, SORRY | |
#### |
<?php | |
class FooController extends Controller { | |
function fooAction() { | |
$em = $this->getDoctrine()->getEntityManager(); | |
$cm = $em->getClassMetadata('FooBundle:FooEntity'); | |
$cm->setTableName('special_table_name'); |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: