Skip to content

Instantly share code, notes, and snippets.


Yuri Teixeira yuriteixeira

View GitHub Profile
yuriteixeira /
Created Aug 28, 2018
Puppeteer/Chrome Dev Tools Protocol: How to manipulate Android Chrome or WebViews

First of all, get prepared by installing the Android SDK and SDK tools in order to get the adb executable. Then:

  1. adb connect <device ip>

  2. To get the service name `adb shell "cat /proc/net/unix | grep devtools_remote", which will give you something like this output:

00000000: 00000002 00000000 00010000 0001 01 423897 @webview_devtools_remote_18279
yuriteixeira /
Created Oct 14, 2015
Xdebug + Tests + IntelliJ
  • SSH to your machine like this: ssh -R 9000:localhost:9000 your.remote.machine
  • Ensure you have Xdebug installed and configured with xdebug.remote_enable=1
  • Add this snippet to your .bash_profile or similar shell init script:
# XDebug  
function xdebug-start {
yuriteixeira / skyscanner.php
Last active Aug 29, 2015
Generate skyscanner search urls. To open then, copy and paste the result on openlist chrome extension (, like you see here:
View skyscanner.php
// Usage :
// php fly.php <start_date> <trip_interval> <variance> <from> <to>
// Eg: A 7 day trip from VIX to STOC, 30 days of variance
// php fly.php 2015-07-01 30 "+7 day" vix stoc
$start = new \DateTime("{$argv[1]}");
$variance = "+{$argv[2]} day";
yuriteixeira /
Created Mar 20, 2015
TDD Made Easy - Run tests when the files change
function tdd {
if [[ -z $pathToTestRunner ]]
yuriteixeira / go-oop-inherit.go
Last active Aug 29, 2015
OOP and Golang: "Inheritance"
View go-oop-inherit.go
package main
import "fmt"
type Foo struct {
what string
howMany int
type Bar struct {
yuriteixeira /
Last active Aug 29, 2015
Boot2Docker + Virtual Box Additions (will make volume share work with Mac OS X)
boot2docker down
mv ~/.boot2docker/boot2docker.iso ~/.boot2docker/boot2docker.iso.backup
cp boot2docker-v1.2.0-virtualbox-guest-additions-v4.3.14.iso ~/.boot2docker/boot2docker.iso
yuriteixeira /
Last active Dec 17, 2015
Filebot AMC (Automated Media Center) Helper
if [ $1 ] && [ $1 == '-h' ]
echo ""
echo "Welcome to Filebot AMC (Automated Media Center) Script."
echo ""
echo "Usage: [torrent_name] [/path/to/torrent] [/path/to/media] [/path/to/log]"
echo ""
echo "NOTES: "
yuriteixeira / gist:5191784
Created Mar 18, 2013
fix problem on doctrine odm
View gist:5191784
protected function loadConnections(array $connections, ContainerBuilder $container)
$cons = array();
foreach ($connections as $name => $connection) {
// Define an event manager for this connection
$eventManagerId = sprintf('doctrine_mongodb.odm.%s_connection.event_manager', $name);
$container->setDefinition($eventManagerId, new DefinitionDecorator('doctrine_mongodb.odm.connection.event_manager'));
$configServiceName = sprintf('doctrine_mongodb.odm.%s_configuration', $name);
yuriteixeira / BehatTest.php
Created Dec 16, 2012 — forked from jakzal/BehatTest.php
A quick and dirty PHPUnit test case that runs behat, making code coverage reports being possible!
View BehatTest.php
use Symfony\Component\Console\Input\ArrayInput;
use Behat\Behat\Console\BehatApplication;
use Symfony\Component\Console\Output\ConsoleOutput;
class BehatTest extends \PHPUnit_Framework_TestCase
public function testThatBehatScenariosMeetAcceptanceCriteria()
View gist:1829820
1) Criar uma entidade chamada StaticFile, com os atributos:
- original_name
- content_type
- slug
- size
2) Alterar a entidade CmsBlock, adicionando o atributo:
- is_published
3) Criar um novo botão no editor TinyMCE, que chamará um popup de upload de imagens
You can’t perform that action at this time.