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 / 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:
# 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:
@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
@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 / gist:1bc2e1fc25c17f7b03262a735d063d3a
Created July 4, 2016 19:36
Commands to ElasticBeanstalk
commands:
00_update_composer:
command: export HOME=/root && export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: COMPOSER_HOME
value: /root
- namespace: aws:elasticbeanstalk:application:environment
option_name: HOME
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker-OceanicNext.tmTheme",
"font_options":
[
"gray_antialias"
],
"font_size": 8,
"ignored_packages":
<?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 / 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