Skip to content

Instantly share code, notes, and snippets.

if [ ! -f /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs ]; then
cd /usr/local/share && wget http://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2 && tar xjf phantomjs-1.9.2-linux-x86_64.tar.bz2 && sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs && sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs && sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
echo "Phantom JS Downloaded"
else
echo "Phantom JS already downloaded"
fi
if ! ps aux | grep "[p]hantomjs" > /dev/null
then
cd /usr/local/share
@mkpeacock
mkpeacock / gist:4028132
Created November 6, 2012 22:35
Custom paramaters to objects contained within pimple
$pimple = new Pimple();
$pimple['some_key'] = $pimple->protect(function($a, $b, $c) use ($pimple) {
return new \MyVendor\MyComponent\MyObject($a,$b,$c, $pimple);
});
$some_object = $pimple['some_key'](1,2,3);