Skip to content

Instantly share code, notes, and snippets.

View chiqui3d's full-sized avatar
😊
Out sick

José Carlos chiqui3d

😊
Out sick
View GitHub Profile
@Nemo64
Nemo64 / doctrine_live_tempaltes.xml
Created March 29, 2021 11:42
Live templates for common doctrine fields
<template name="bool:default" value="/**&#10; * @var bool&#10; * @ORM\Column(type=&quot;boolean&quot;, options={&quot;default&quot;: $default$})&#10; */&#10;private bool $$$name$ = $default$;&#10;&#10;$END$&#10;&#10;public function is$method$(): bool&#10;{&#10; return $this-&gt;$name$;&#10;}&#10;&#10;public function set$method$(bool $$$name$): void&#10;{&#10; $this-&gt;$name$ = $$$name$;&#10;}" description="boolean column" toReformat="false" toShortenFQNames="true">
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="default" expression="enum(&quot;false&quot;, &quot;true&quot;)" defaultValue="" alwaysStopAt="true" />
<variable name="method" expression="capitalize(name)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP Class Member" value="true" />
</context>
</template>
<template name="bool:nullable" value="/**&#10; * @var bool|null&#10; * @ORM\Column(type=&quot;boolean&quot;, nullable=true)&#10; */&#10;private ?bool $$$name$ = nul
@dkarlovi
dkarlovi / Dockerfile
Last active March 18, 2020 07:45
Symfony + RoadRunner + build-time cache volume Dockerfile
# syntax=docker/dockerfile:experimental
FROM alpine:3.11 AS runtime
WORKDIR /app
RUN addgroup -g 82 -S www-data && \
adduser -u 82 -H -D -S -G www-data www-data && \
apk add --update --no-cache \
php7 \
php7-ctype \
php7-dom \
php7-iconv \
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 9, 2024 19:08
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@florentdestremau
florentdestremau / NewPasswordType.php
Last active March 10, 2023 13:17
A simple User authentication setup to copy & paste into your Symfony 3.4 install
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
@StefanNieuwenhuis
StefanNieuwenhuis / reactiveconf-framework-independent-components-library-with-StencilJS.md
Last active September 23, 2020 12:55
How to build a framework independent component library with StencilJS

How to build a framework independent component library with StencilJS

This is a proposal for a lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal! If you're on your phone, please request the 🖥 desktop site to star this gist 😇 #ReactiveConf

@chiqui3d
chiqui3d / gulpfile.js
Last active December 25, 2021 09:59
Gulpfile to deploy Symfony or Laravel projects with SSH
var gulp = require('gulp');
var rsync = require('gulp-rsync');
var GulpSSH = require('gulp-ssh')
var fs = require('fs');
var shell = require('gulp-shell');
var dotenv = require('dotenv');
var parseDbUrl = require("parse-database-url");
/**
* DEPLOY
@adamsafr
adamsafr / AbstractBySlugAndActiveSearcher.php
Last active March 31, 2023 09:03
Symfony: ParamConverter usage example
<?php
namespace FrontEndBundle\Request\ParamConverter;
use Doctrine\Bundle\DoctrineBundle\Registry;
use Doctrine\Common\Persistence\ObjectRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
abstract class AbstractBySlugAndActiveSearcher
@kubaceg
kubaceg / Dockerfile
Created May 4, 2017 07:30
Docker install ioncube extension (php 5.6)
RUN curl -o ioncube.tar.gz http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \
&& tar -xvvzf ioncube.tar.gz \
&& mv ioncube/ioncube_loader_lin_5.6.so `php-config --extension-dir` \
&& rm -Rf ioncube.tar.gz ioncube \
&& docker-php-ext-enable ioncube_loader_lin_5.6
@adambene
adambene / urrying-in-javascript-es6-renderhtml.js
Last active July 2, 2022 15:29
Currying in JavaScript ES6 - render HTML
renderHtmlTag = tagName => content => `<${tagName}>${content}</${tagName}>`
renderDiv = renderHtmlTag('div')
renderH1 = renderHtmlTag('h1')
console.log(
renderDiv('this is a really cool div'),
renderH1('and this is an even cooler h1')
)
@SerafimArts
SerafimArts / Annotation.js
Last active October 24, 2023 22:47
JavaScript Annotations example
import Reader from './Reader';
import Target from './Target';
/**
* This is default annotation property for automatic type casting:
* <code>
* @Annotation({ some: any })
* // => will be casts "as is" {some: any}
*
* @Annotation("any")