Skip to content

Instantly share code, notes, and snippets.

View juniorb2ss's full-sized avatar
🎯
Focusing

Carlos E. Oliveira juniorb2ss

🎯
Focusing
View GitHub Profile
@juniorb2ss
juniorb2ss / Dockerfile
Created March 9, 2021 16:28
ext-fiber dockerfile
FROM php:latest
RUN apt-get update && \
apt-get install -y git && \
git clone https://github.com/amphp/ext-fiber && \
cd ext-fiber && phpize && ./configure && make && make test && make install
RUN echo '\
extension=fiber\n\
' >> /usr/local/etc/php/conf.d/docker-php-ext-fiber.ini
<?php
$studentFirstPoints = $_GET['a'] ?? null;
$studentSecondPoints = $_GET['b'] ?? null;
try {
$studentPointsCalculator = new StudentPointsCalculator($studentFirstPoints, $studentSecondPoints);
$studentPointsCalculator->studentWasApproved();
@juniorb2ss
juniorb2ss / HardCoreDebugLogger.php
Created April 21, 2019 20:22 — forked from lyrixx/HardCoreDebugLogger.php
Hardcore Debug Logger
<?php
const STREAM_OPEN_FOR_INCLUDE = 128;
final class HardCoreDebugLogger
{
public static function register(string $output = 'php://stdout')
{
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
@juniorb2ss
juniorb2ss / GuzzleClientProvider.php
Last active April 6, 2019 15:12
Laravel Logging All Guzzle Request/Response to Elasticsearch
<?php
namespace App\Service\Tray\Provider;
use Carbon\Carbon;
use Monolog\Logger;
use GuzzleHttp\Middleware;
use GuzzleHttp\HandlerStack;
use App\Library\Configurations;
use Elastica\Client as EClient;
@juniorb2ss
juniorb2ss / bitbucket-pipeline.yml
Last active February 8, 2024 10:52
Bitbucket Pipeline Deploy Laravel to Elasticbeanstalk using parallel steps
image: atlassian/default-image:2
definitions:
services:
redis:
image: redis:3.2
memory: 512
mysql:
image: mysql:5.7
environment:
@juniorb2ss
juniorb2ss / check.py
Last active January 19, 2021 15:10
Python script to make diff for same k:v between different redis db's
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
from __future__ import print_function
import redis
import json
import time
from itertools import zip_longest
from clint.arguments import Args
@juniorb2ss
juniorb2ss / statuses.md
Created February 17, 2019 05:22 — forked from vkostyukov/statuses.md
HTTP status codes used by world-famous APIs
API Status Codes
[Twitter][tw] 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504
[Stripe][stripe] 200, 400, 401, 402, 404, 429, 500, 502, 503, 504
[Github][gh] 200, 400, 422, 301, 302, 304, 307, 401, 403
[Pagerduty][pd] 200, 201, 204, 400, 401, 403, 404, 408, 500
[NewRelic Plugins][nr] 200, 400, 403, 404, 405, 413, 500, 502, 503, 503
[Etsy][etsy] 200, 201, 400, 403, 404, 500, 503
[Dropbox][db] 200, 400, 401, 403, 404, 405, 429, 503, 507
@juniorb2ss
juniorb2ss / git-update-fork.sh
Created April 23, 2018 01:56 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
'use strict';
var Promise = require('bluebird');
var AWS = require('aws-sdk');
// Check if environment supports native promises
if (typeof Promise === 'undefined') {
AWS.config.setPromisesDependency(require('bluebird'));
}
# This is a sample build configuration for Javascript.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:6.9.2
pipelines:
branches:
master: