Skip to content

Instantly share code, notes, and snippets.

View pilot's full-sized avatar
💭
Wobbly.me, time tracker & resource planning for teams, open source

Alex Demchenko pilot

💭
Wobbly.me, time tracker & resource planning for teams, open source
View GitHub Profile
@pilot
pilot / gist:2251778
Created March 30, 2012 14:10
Generate composer.json
{
"name": "bundle/mybundle",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.2",
"symfony/symfony": "2.1.*",
"doctrine/orm": "2.2.*",
"doctrine/doctrine-bundle": "*",
@pilot
pilot / FeatureContext.php
Created June 20, 2012 08:02 — forked from weaverryan/FeatureContext.php
Behat Definition to help click generic links on different rows of a table
<?php
// ...
class FeatureContext extends MinkContext
{
/**
* Looks for a table, then looks for a row that contains the given text.
* Once it finds the right row, it clicks a link in that row.
*
UserBundle_users_list:
   pattern:  /users/{page}.{_format}
   defaults: { _controller: UserBundle:Users:list, page: 1, _format: html }
   requirements:
      _format:  html
<?php
/**
* Recognizes mData sent from DataTables where dotted notations represent a related
* entity. For example, defining the following in DataTables...
*
* "aoColumns": [
* { "mData": "id" },
* { "mData": "description" },
* { "mData": "customer.first_name" },
* { "mData": "customer.last_name" }
<?php
// ...
class FeatureContext extends MinkContext
{
/**
* Looks for a table, then looks for a row that contains the given text.
* Once it finds the right row, it clicks a link in that row.
*
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.0.deb
sudo dpkg -i elasticsearch-0.90.0.deb
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\SwitchUserRole;
@pilot
pilot / gist:6507167
Created September 10, 2013 09:39 — forked from jedi4ever/gist:944216
VERSION=2.2.5
apt-get -y install wget
rm -rf redis-$VERSION
wget http://redis.googlecode.com/files/redis-2.2.5.tar.gz -O redis-$VERSION.tar.gz
tar -xzvf redis-$VERSION.tar.gz
cd redis-$VERSION
./configure --prefix=/usr
make
rm -rf /tmp/redis-$VERSION.$$
mkdir /tmp/redis-$VERSION.$$
@pilot
pilot / README.md
Created January 13, 2014 15:28 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
<?php
/**
* @Given /^I select the "(?P<field>([^""]|\\")*)" radio button$/
*/
public function iSelectTheRadioButton($field)
{
$field = str_replace('\\"', '"', $field);
$radio = $this->getSession()->getPage()->findField($field);