Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Carlos Eduardo Oliveira Junior juniorb2ss

🎯
Focusing
Block or report user

Report or block juniorb2ss

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View studentPointsCalculator.php
<?php
$studentFirstPoints = $_GET['a'] ?? null;
$studentSecondPoints = $_GET['b'] ?? null;
try {
$studentPointsCalculator = new StudentPointsCalculator($studentFirstPoints, $studentSecondPoints);
$studentPointsCalculator->studentWasApproved();
View HardCoreDebugLogger.php
<?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 Apr 6, 2019
Laravel Logging All Guzzle Request/Response to Elasticsearch
View GuzzleClientProvider.php
<?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 Sep 18, 2019
Bitbucket Pipeline Deploy Laravel to Elasticbeanstalk using parallel steps
View bitbucket-pipeline.yml
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 May 23, 2019
Python script to make diff for same k:v between different redis db's
View check.py
#!/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 Feb 17, 2019 — forked from vkostyukov/statuses.md
HTTP status codes used by world-famous APIs
View statuses.md
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 Apr 23, 2018 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
View git-update-fork.sh
#!/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
View promise.js
'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'));
}
View bitbucket-pipelines.yml
# 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:
View lambda-email-foward.js
"use strict";
console.log("AWS Lambda SES Forwarder // @arithmetric // Version 3.0.0");
// Configure the S3 bucket and key prefix for stored raw emails, and the
// mapping of email addresses to forward from and to.
//
// Expected keys/values:
// - fromEmail: Forwarded emails will come from this verified address
// - emailBucket: S3 bucket name where SES stores emails.
You can’t perform that action at this time.