Skip to content

Instantly share code, notes, and snippets.

View javigomez's full-sized avatar

Javier Gomez javigomez

View GitHub Profile
@javigomez
javigomez / Origin to Upstream
Created October 22, 2012 15:14
Git command to rename the origin to upstream when you just forked a project
git remote rename origin upstream
git add remote origin git@github.com:user/fork.git
@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>"
@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 / finder.sh
Created July 31, 2014 15:31
Show .git and other system hidden files in Mac Finder
# Just run this:
defaults write com.apple.finder AppleShowAllFiles TRUE
@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 / selectize-codeception-stepObject.php
Created November 10, 2015 11:25
Select option in Selectize JS library with Selenium and Codeception
/**
* Selects an option in a Chosen Selector based on its label
*
* @return void
*/
public function selectOptionInSelectize($label, $option)
{
$I = $this;
$I->waitForJS("return jQuery(\"label:contains('$label')\");");
$selectID = $I->executeJS("return jQuery(\"label:contains('$label')\").attr(\"for\");");
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