Skip to content

Instantly share code, notes, and snippets.

View javigomez's full-sized avatar

Javier Gomez javigomez

View GitHub Profile
@javigomez
javigomez / Codeception.md
Last active August 29, 2015 14:04
Codeception

Codeception

Create project

Create a codeception project

php codecept.phar bootstrap

Build actors

@javigomez
javigomez / getjoomlacli.php
Last active August 29, 2015 14:14
Get joomla staging Joomla Framework CLI app
<?php
/**
* @package Joomla
* @subpackage Tests
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Maximise error reporting.
@javigomez
javigomez / gist:3931973
Created October 22, 2012 15:15 — forked from mbabker/gist:3211464
Creating a category via component postflight
// Get the database object
$db = JFactory::getDbo();
// JTableCategory is autoloaded in J! 3.0, so...
if (version_compare(JVERSION, '3.0', 'lt'))
{
JTable::addIncludePath(JPATH_PLATFORM . 'joomla/database/table');
}
// Initialize a new category
@javigomez
javigomez / gist:5636793
Created May 23, 2013 15:11
Change commit author to previous commited commit
git commit --amend --author="Author Name <email@address.com>"
How to have two different Firefox versions the one for cheesecake and the latest (for the coverage matrix)
https://support.mozilla.org/en-US/questions/797010
1. Install (i.e., drag) Firefox4.x into a different folder than Firefox 3.8.x (a sub-folder of the Applications folder or wherever else you like).
2. Launch Firefox 4 with the Profile Manager by entering the following in a Terminal window:
/Path/to/Firefox.app/Contents/MacOS/firefox-bin -ProfileManager
Replace the "/Path/to" part with the actual path (duh) and type a "Return" at the end of the line.
3. Create a new profile for the 4.x version and uncheck the "Don't ask at startup" box, then click the "Start Firefox" button.
@javigomez
javigomez / step.rb
Created November 10, 2016 10:25
running cucumber tests in slow motion
AfterStep() do
sleep 2
end
AfterStep() do
print "Single Stepping. Hit enter to continue"
STDIN.getc
end
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --headless --remote-debugging-port=9222 --disable-gpu https://chromium.org
@javigomez
javigomez / nested.rb
Last active October 23, 2017 14:13
nested to_json in ruby
# require 'active_support'
# require 'active_support/core_ext'
require 'json'
require 'values'
class Statement < Value.new(:title, :description)
def to_json(state = nil)
{
title: title,
properties: {
@javigomez
javigomez / progress_bar.feature
Created November 23, 2017 16:05
Progress Bar Feature Gherkin
Feature: Progress bar functionality
As a typeform user
I want to see the progress bar
So I know how many questions do I still have to answer
@javigomez
javigomez / progress_bar_imperative_gherkin.feature
Created November 23, 2017 16:07
wrong progress bar feature
Scenario: Progress bar status if block is answered
Given I have visited a typeform with 3 blocks
And the "What is your name" "short text" block is focused
When I answer "my name is Javi"
And I click "Ok button"
Then the progress bar should increase to 33%
Then the "How old are you" "number" block is focused
When I answer "35"
...