Skip to content

Instantly share code, notes, and snippets.

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

Alef Castelo alefcastelo

🏠
Working from home
View GitHub Profile
class ErrorBase<T> extends Error {
constructor(public readonly type: string, public readonly reason: string) {
super(reason)
}
}
class MemberCreateInputError extends ErrorBase<MemberCreateInputError> {
constructor(reason: string) {
super('invalid.member_create_input', reason)
}
@alefcastelo
alefcastelo / sources.list
Created January 25, 2022 17:33 — forked from ishad0w/sources.list
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
<?php
namespace AlefCastelo;
use Attribute;
use ArrayObject;
use Exception;
use ReflectionObject;
use ReflectionProperty;
use RuntimeException;
<?php
interface QueryBuilderInterface
{
public function getConfig(): array;
}
class UserQueryBuilder implements QueryBuilderInterface
{
private $config = [];
@alefcastelo
alefcastelo / docker-compose.yml
Created October 24, 2018 09:52
Elasticsearch+Kibana
version: '3'
services:
elasticsearch:
image: elasticsearch:6.4.1
environment:
- discovery.type=single-node
ports:
- 9200:9200
kibana:
@alefcastelo
alefcastelo / Jenkinsfile
Created January 23, 2018 16:35 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
{
"repositories": [
{
"type": "git",
"url": "git@github.com:alefcastelo/project-domain.git"
}
],
"require": {
"php": "^5.5 || ^7.0",
"project/domain": "dev-master",
FROM php:5.6-apache
WORKDIR /var/www
RUN apt-get update && apt-get install -y \
aptitude \
apt-utils \
pkg-config \
libpcre3-dev \
libzip-dev \
<?php
namespace App\Credential;
use Utreino\Core\Domain\Repository\RepositoryInterface;
use Utreino\Core\Infrastructure\Proxy\RepositoryPaginatorProxy;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;
<?php
namespace App\Credential;
use Utreino\Core\Domain\Repository\RepositoryInterface;
use Utreino\Core\Infrastructure\Proxy\RepositoryPaginatorProxy;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;