Skip to content

Instantly share code, notes, and snippets.

Working from home

Juan Luis García Borrego JuanLuisGarciaBorrego

Working from home
View GitHub Profile
pablosbrain / NodePuppeteerTest.js
Last active Sep 1, 2020
Simple Node.js Puppeteer PDF Output Example
View NodePuppeteerTest.js
const puppeteer = require('puppeteer');
const path = require('path');
var browser, page;
(async () => {
browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox']
, headless: true // printo to pdf only works in headless mode currently
page = await browser.newPage();
kaz231 / gist:fadfc22aee7ea5dede6870029baff01b
Created Dec 6, 2016
Building of symfony project using deployer - example
View gist:fadfc22aee7ea5dede6870029baff01b
namespace Deployer;
require 'recipe/symfony3.php';
set('build_dir', dirname(__FILE__).'/build/');
set('build_branch', 'master');
set('bin/console', '{{ build_dir }}bin/console');
set('files_to_remove', [
nrollr /
Last active Apr 5, 2021
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

evantahler / main.yml
Last active Jul 12, 2019
CertBot + Ansible
View main.yml
# tasks/main.yml
- name: install certbot dependencies
apt: name={{ item }} state=present
- build-essential
- libssl-dev
- libffi-dev
- python-dev
- git
diegonobre /
Last active Mar 29, 2020 — forked from tjamps/
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authenticationu
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g.

The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :

roukmoute / EntityRepository.php
Last active Jan 28, 2021
Concrete example of WHERE...IN subquery in doctrine 2
View EntityRepository.php
class MyRepository extends EntityRepository
public function whereInSubQuery(User $user)
$queryBuilder = $this->createQueryBuilder('my_repository');
palvestegui / Mata Contratos.docx
Created Aug 27, 2015
Modified Spanish version of @malarkey's Killing Contract
View Mata Contratos.docx
<h2><strong>Contrato de Diseño de un Sitio Web <span style="text-decoration: line-through;">un Sistema Informático</span></strong></h2>
Acordado entre <strong>Usted</strong> [Nombre del cliente] y<strong> nosotros</strong>, [Nuestra Empresa]
Siempre haremos nuestro mejor esfuerzo para cumplir con sus expectativas y satisfacer sus necesidades, pero es importante tener las cosas escritas para que ambos sepamos qué es qué, quién debería hacer qué y cuándo y, qué es lo que pasará si algo sale mal.
En este contrato no encontrará complicados términos legales ni largos pasajes de texto inentendible. No tenemos la intención de hacerle firmar algo que después lamentará. Lo que sí, queremos lo que es mejor para ambas partes, ahora y en el futuro.
En pocas palabras:
<strong>Usted</strong> ([Nombre del cliente]), situado en [dirección del cliente], nos contrata a <strong>Nosotros</strong> ([Nombre de la empresa]) situados en [dirección de la empresa] para diseñar y desarrollar [un si
magicznyleszek /
Last active Apr 6, 2021
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Element selectors

Element -- selects all h2 elements on the page

h2 {
    foo: bar;
ziadoz / console.php
Created Sep 4, 2012
Symfony Console Component Example
View console.php
#!/usr/bin/env php
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Finder\Finder;
brtriver / index.php
Created Mar 18, 2012
silex with cookie
View index.php
require __DIR__ .'/silex.phar';
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Cookie;
$app = new Silex\Application();
$app['debug'] = true;