Skip to content

Instantly share code, notes, and snippets.

@chanmix51
chanmix51 / create_pomm2_silex.sh
Last active August 29, 2015 14:11
Pomm2 Silex project creation script
#!/bin/bash
echo "Project setup";
echo -n "What is your project name ['Test']:> ";
read project_name;
echo "Postgresql setup";
echo -n "What is your Postgresql username [$USER]:> ";
read db_username;
echo -n "What is this user's password (empty if none) [] :> ";
read db_password;
@chanmix51
chanmix51 / create-pomm-silex.sh
Last active February 25, 2018 17:11
Silex project bootstrap with Pomm
#!/bin/bash
mkdir -p bin sources/{config,twig,sql,lib/{Model,Controller}} web/{css,images,js} tests documentation log
chmod 777 log
> web/favicon.ico
cat > bin/generate_model.php <<"EOF"
<?php // bin/generate_model.php
$app = require(__DIR__."/../sources/bootstrap.php");
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

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 = git@github.com: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:

@weaverryan
weaverryan / FeatureContext.php
Created June 19, 2012 21:05
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.
*