Skip to content

Instantly share code, notes, and snippets.

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

Gerardo Fernández Moreno ger86

🏠
Working from home
View GitHub Profile
@ger86
ger86 / Dockerfile-php
Created February 4, 2020 15:09
Dockerfile-php
FROM php:fpm-stretch
ENV ACCEPT_EULA=Y
ARG APCU_VERSION=5.1.11
RUN apt-get update && apt-get install -y gnupg2 locales openssl apt-transport-https ca-certificates \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \
@ger86
ger86 / default.conf
Created February 4, 2020 15:08
default.conf for Dockerfile-nginx
server {
listen 80;
root /var/www/rocket/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
# Connect to the Docker service using fpm
@ger86
ger86 / Dockerfile-nginx
Created February 4, 2020 15:08
Dockerfile-nginx
FROM nginx:latest
COPY ./build/nginx/default.conf /etc/nginx/conf.d/
@ger86
ger86 / docker-compose-php.yml
Created February 4, 2020 15:07
Docker Compose for PHP
version: '3'
services:
php:
build:
context: .
dockerfile: Dockerfile-php
args:
- WITH_XDEBUG=false
environment:
@ger86
ger86 / js2020.js
Created January 29, 2020 11:08
JS: Novedades 2020
/****************************************************************
*
*
* 🆕🆕🆕 Nuevas características de Javascript en 2020
*
*
*****************************************************************/
/**
*
import React, { createContext, useContext, useReducer } from "react";
import ReactDOM from "react-dom";
const CounterContext = createContext();
const reducer = (state, action) => {
switch (action.type) {
case "ADD_TO_COUNTER": {
return {
...state,
import React, { createContext, useContext } from "react";
import ReactDOM from "react-dom";
const CounterContext = createContext({
counter: 0
});
const Display = () => {
const context = useContext(CounterContext);
return <h1>Valor del contador: {context.counter}</h1>;
import React, { useState, useContext } from 'react';
import ReactDOM from 'react-dom';
const Display = ({ counter }) => <h1>Valor del contador: {counter}</h1>;
const Increment = ({ addToCounter }) => (
<button onClick={() => addToCounter(1)}>Sumar 1</button>
);
const Decrement = ({ addToCounter }) => (
<button onClick={() => addToCounter(-1)}>Restar 1</button>
<?php
namespace App\Model\DTO;
class StripeProcessSubscriptionDTO {
private $planId;
private $stripeToken;
private $stripeTokenType;
<?php
namespace App\Tests;
use Symfony\Component\Panther\PantherTestCase;
class BlogPostsControllerTest extends PantherTestCase {
public function testShowPost() {
$client = static::createPantherClient();
$client->followRedirects();