Skip to content

Instantly share code, notes, and snippets.

View humbertodosreis's full-sized avatar

Humberto dos Reis Rodrigues humbertodosreis

View GitHub Profile
@humbertodosreis
humbertodosreis / Convert .mov or .MP4 to .gif.md
Created May 9, 2024 19:42 — forked from SheldonWangRJT/Convert .mov or .MP4 to .gif.md
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@humbertodosreis
humbertodosreis / pipeline
Created April 26, 2021 19:52 — forked from mmonti/pipeline
Pipeline Pattern in Kotlin
package com.sunrun.fi.ingestion.input
import java.io.ByteArrayOutputStream
import java.nio.file.Paths
import java.util.zip.ZipInputStream
interface Step<I, O> {
fun process(input : I) : O
}
functions:
hello:
handler: handler.hello
events:
- http:
path: users
method: get
integration: lambda
request:
template:
@humbertodosreis
humbertodosreis / cognito.yaml
Created February 10, 2020 20:30 — forked from singledigit/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@humbertodosreis
humbertodosreis / heroku_pg_db_reset.md
Created October 22, 2019 22:25 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate

@humbertodosreis
humbertodosreis / Heroku.md
Created October 22, 2019 22:25 — forked from stevenyap/Heroku.md
Heroku setup and list of commands

Note that Heroku Config is found in /.git/config
** Make sure you have setup your git properly before pushing to Heroku **

Pre-conditions for app on Heroku

<?php
namespace App\Infra;
class SwooleDaemon
{
/**
* @var int[]
*/
private $pipes = [];
@humbertodosreis
humbertodosreis / 1_usecase.php
Created July 6, 2018 15:00 — forked from makasim/1_usecase.php
Async non blocking process daemon. Stderr\Stdout proxy, Child reboot on exit, Graceful child exit on sigterm, reload on usr1 signal
<?php
use Symfony\Component\Process\PhpExecutableFinder;
require_once __DIR__.'/../vendor/autoload.php';
$phpBin = (new PhpExecutableFinder)->find();
if (false === $phpBin) {
throw new \LogicException('Php executable could not be found');
}
@humbertodosreis
humbertodosreis / symfony3-rest-api.md
Created June 14, 2018 20:44 — forked from diegonobre/symfony3-rest-api.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authenticationu
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :