Skip to content

Instantly share code, notes, and snippets.

View humbertodosreis's full-sized avatar

Humberto dos Reis Rodrigues humbertodosreis

View GitHub Profile
@huytd
huytd / wordle.md
Last active May 16, 2024 20:39
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@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
}
@mmonti
mmonti / pipeline
Created February 28, 2020 17:45
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:
@dam5s
dam5s / Result.kt
Last active June 22, 2022 21:28
Railway oriented programming in Kotlin - This is code accompanying my blog post https://medium.com/@its_damo/error-handling-in-kotlin-a07c2ee0e06f
sealed class Result<A, E> {
fun <B> map(mapping: (A) -> B): Result<B, E> =
when (this) {
is Success -> Success(mapping(value))
is Failure -> Failure(reason)
}
fun <B> bind(mapping: (A) -> Result<B, E>): Result<B, E> =
when (this) {
is Success -> mapping(value)
@ownport
ownport / multiprocessing_producer_consumer.py
Created December 5, 2017 11:28
python | multiprocessing producer consumer
# multiprocessing_producer_consumer.py
# https://pymotw.com/3/multiprocessing/communication.html
import multiprocessing
import time
class Consumer(multiprocessing.Process):
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 15, 2024 22:27
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.

@makasim
makasim / 1_usecase.php
Last active August 1, 2018 14:03
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');
}
@singledigit
singledigit / cognito.yaml
Last active April 28, 2024 15:12
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: