Skip to content

Instantly share code, notes, and snippets.

View JuanLuisGarciaBorrego's full-sized avatar
🏠
Working from home

Juan Luis García Borrego JuanLuisGarciaBorrego

🏠
Working from home
View GitHub Profile
@kaz231
kaz231 / gist:fadfc22aee7ea5dede6870029baff01b
Created December 6, 2016 11:17
Building of symfony project using deployer - example
<?php
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', [
@evantahler
evantahler / main.yml
Last active July 12, 2019 18:36
CertBot + Ansible
# tasks/main.yml
- name: install certbot dependencies
apt: name={{ item }} state=present
with_items:
- build-essential
- libssl-dev
- libffi-dev
- python-dev
- git
@brtriver
brtriver / index.php
Created March 18, 2012 08:48
silex with cookie
<?php
require __DIR__ .'/silex.phar';
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Cookie;
$app = new Silex\Application();
$app['debug'] = true;
@palvestegui
palvestegui / Mata Contratos.docx
Created August 27, 2015 16:24
Modified Spanish version of @malarkey's Killing Contract
<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]
<h2><strong>Resumen:</strong></h2>
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
@pablosbrain
pablosbrain / NodePuppeteerTest.js
Last active September 1, 2020 08:49
Simple Node.js Puppeteer PDF Output Example
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();
@ziadoz
ziadoz / console.php
Created September 4, 2012 22:45
Symfony Console Component Example
#!/usr/bin/env php
<?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;
@roukmoute
roukmoute / EntityRepository.php
Last active July 27, 2023 15:07
Concrete example of WHERE...IN subquery in doctrine 2
<?php
class MyRepository extends EntityRepository
{
public function whereInSubQuery(User $user)
{
$queryBuilder = $this->createQueryBuilder('my_repository');
$queryBuilder
->where(
$queryBuilder->expr()->in(
@diegonobre
diegonobre / symfony3-rest-api.md
Last active January 5, 2024 14:36 — forked from tjamps/README.md
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. v1.api.example.com)

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

@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
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 https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • 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 :

@magicznyleszek
magicznyleszek / css-selectors.md
Last active March 29, 2024 01:12
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {