Skip to content

Instantly share code, notes, and snippets.

@khoa-le
khoa-le / parameters_test.circle.yml
Last active June 6, 2016 15:26
Config parameter for Circle CI on Symfony
parameters:
database_host: 127.0.0.1
database_port: ~
database_name: circle_test
database_user: ubuntu
database_password: null
@khoa-le
khoa-le / circle.yml
Created June 6, 2016 15:16
Circle CI config with symfony and capifony
machine:
php:
version: 7.0.0RC7
ruby:
version: 2.0.0-p481
dependencies:
override:
- composer install --prefer-source --no-interaction --no-scripts
- cp app/config/parameters_test.circle.yml app/config/parameters_test.yml
@khoa-le
khoa-le / background.feature
Created June 6, 2016 10:19
Example for background behat
Background:
Given a global administrator named "Greg"
And a blog named "Greg's anti-tax rants"
And a customer named "Wilson"
And a blog named "Expensive Therapy" owned by "Wilson"
@khoa-le
khoa-le / scenario_outline.feature
Created June 6, 2016 09:45
Example for scenario outline
Scenario Outline: Eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
@khoa-le
khoa-le / copy_paste_scenario.feature
Last active June 6, 2016 09:40
Example for scenario copy paste
Scenario: Eat 5 out of 12
Given there are 12 cucumbers
When I eat 5 cucumbers
Then I should have 7 cucumbers
Scenario: Eat 5 out of 20
Given there are 20 cucumbers
When I eat 5 cucumbers
Then I should have 15 cucumbers
@khoa-le
khoa-le / dashboard.feature
Last active June 6, 2016 08:56
Example for first Scenario
Scenario: Log in with username and password
Given I am on the store homepage
And I follow "Login"
When I fill in the following:
| Email | [email protected] |
| Password | foo1 |
And I press "Login"
Then I should be redirected to the store homepage
And I should see "Logout"
@khoa-le
khoa-le / bash.sh
Created May 26, 2016 12:50
create new account for mattermost
#!/bin/bash
go run mattermost.go -create_team -team_name="khoa" -email="[email protected]"
go run mattermost.go -create_user -team_name="khoa" -email="[email protected]" -password="123456"
go run mattermost.go -assign_role -team_name="khoa" -email="[email protected]" -role="system_admin"
@khoa-le
khoa-le / IndexController.php
Last active May 21, 2016 03:11
Action to pure cache from gateway in symfony
<?php
/**
* @param Request $request
* @param string $subdomain
* @return Response
*/
public function purecacheAction(Request $request, $subdomain)
{
$servers = array('127.0.0.1'); // Port 80 assumed for 10.0.0.1
$client = new Symfony($servers, 'http://your-url.com');
@khoa-le
khoa-le / index.html
Created May 16, 2016 10:39
How to embed gist to ghost blog
<script src="https://gist.github.com/alexellis/0bb982253f3619e29f18.js"></script>
@khoa-le
khoa-le / command.sh
Last active March 8, 2016 09:20
Added account to grand permission system admin Mattermost
/platform -assign_role -team_name="khoa" -email="[email protected]" -role="system_admin"