Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fadonascimento's full-sized avatar

Fabricio Henrique fadonascimento

View GitHub Profile
.video-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content {
width: 34em;
left: -19em;
}
.video-js .vjs-menu-button-popup .vjs-menu .vjs-menu-title {
background-color: #020699;
}
.video-js .vjs-menu-button-popup .vjs-menu .vjs-menu-item {
@fadonascimento
fadonascimento / gist:6e489b1a4c923bad89c4b6f96712aa78
Created October 30, 2017 18:22
behat selenium wait for steps
class FeatureContext extends MinkContext {
/**
* @Given /^I wait for css element "([^"]+)" to (appear|disappear)$/
*/
public function iWaitForCssElement($element, $appear)
{
$xpath = $this->getSession()->getSelectorsHandler()->selectorToXpath('css', $element);
$this->waitForXpath($xpath, $appear == 'appear');
}
@fadonascimento
fadonascimento / gist:39d338c011ebf2911dc12ca5d6b94530
Created December 11, 2016 17:13
Take screenshot with behat
use Behat\Mink\Driver\Selenium2Driver;
use Behat\Behat\Hook\Scope\AfterStepScope;
/**
* @When /^I take a screnshoot "([^"]*)"$/
*/
public function takeScreenShotAfterFailedStep($filePath)
{
(function($) {
var o = $({});
$.subscribe2 = function() {
o.on.apply(o, arguments);
};
$.unsubscribe2 = function() {
o.off.apply(o, arguments);
public function getUrl($image,$options){
$url = Configure::read('webroot_url').'/img/myimg/empty.jpg';
if($this->validate($image,$options)){
/*configurar uma variavel global para pegar url padrão do site neste arquivo*/
$url = 'http://'.$this->s3defaults['cloud_front'].$image['alias'].'/'.$image[$image['alias'].'_id'].'/'.(isset($options['rel'])?$options['rel'].'-':'').$image['name'];
}
return $url;
}
@fadonascimento
fadonascimento / HtmlHelper::image()
Created August 28, 2014 20:20
Verifica se existe a Imagem pelo HtmlHelper
/**
* Verificar se a imagem existi
* caso ela exista retorna para o helper do html
* se ela não existir retorna false para não exibir a div sem imagem
*
*/
public function image($path, $options = array())
{
$realPatch = ROOT . DS . APP_DIR . DS . WEBROOT_DIR . 'img' . DS . join(DS,explode('/',$path));