Skip to content

Instantly share code, notes, and snippets.

View hermesespinola's full-sized avatar
:shipit:
Bazinga

Hermes Espínola González hermesespinola

:shipit:
Bazinga
View GitHub Profile
@hermesespinola
hermesespinola / kafka-consumers-lag.js
Created August 12, 2021 04:10
Two simple kafka consumers with lag
const { Kafka } = require('kafkajs');
const topic = 'test-burrow';
const groupId = `test-burrow-group-699`;
const clientId = 'kafka-burrow-test';
const nConsumers = 2;
const consumerDelays = Array.from({ length: nConsumers }).map((_, i) => 500 + 500 * i);
console.log(`GroupID is ${groupId}`);
@hermesespinola
hermesespinola / tf_pre-commit.sh
Last active April 9, 2021 17:05
Apply terraform fmt before a git commit
TF_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.tf$')
if [ ! -z $TF_FILES ]; then
echo $TF_FILES | xargs -I'{}' -n1 sh -c "terraform fmt -list=false '{}'"
if [ $? -eq 1 ]; then
echo '⚠️ Aborting commit due to terraform errors'
exit 1
else
echo '✨ Terraform files looking good'
/**
* ! Babel plugins
* * @babel/plugin-proposal-nullish-coalescing-operator
* * @babel/plugin-proposal-optional-chaining
* * @babel/plugin-proposal-class-properties
* * @babel/plugin-proposal-private-methods
* * @babel/plugin-syntax-bigin
*/
// ! Private class variables
package lpalomin;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.AbstractButton;
@hermesespinola
hermesespinola / keybase.md
Created June 13, 2018 21:39
Keybase proof

Keybase proof

I hereby claim:

  • I am hermesespinola on github.
  • I am hermesespinola (https://keybase.io/hermesespinola) on keybase.
  • I have a public key ASBPevMj0f9gYjjbUGANniWHLDga-lANyImztg3_k30UqAo

To claim this, I am signing this object:

@hermesespinola
hermesespinola / BusyBeaver.scala
Last active October 15, 2021 17:55
BusyBeaver.scala
#!/bin/sh
exec scala "$0" "$@"
!#
// Finds busy beaver state machines of two symbols and four states
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
import scala.language.implicitConversions
@hermesespinola
hermesespinola / friendlist.json
Last active August 12, 2021 04:08
A json list of my true friends
{
"friends": [
{
"name": "Hermes",
"hobby": "Guitar",
"age": 20,
"phone": "+5211337435",
"address": "P. Sherman, Wallaby St. 42, Sydney"
},
{
@hermesespinola
hermesespinola / play_deploy.sh
Last active June 30, 2020 20:40
Simple script to deploy play application
#!/bin/bash
# Bash Version 3 required (it also works with ksh)
[[ ${BASH_VERSINFO[0]} -lt 3 ]] && exit 1
# Defaults
SECRET=secret
PORT=9000
# Put all arguments in a new array (because BASH_ARGV is read only)
@hermesespinola
hermesespinola / Agent.cs
Created March 29, 2017 20:57
Unity Graph Agent
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// a.k.a. Enemy
public class PFTest : MonoBehaviour {
public Node start;
private Node end;
@hermesespinola
hermesespinola / Pathfinding.cs
Created March 29, 2017 20:54
Unity Breath and Depth first search
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pathfinding {
public static List<Node> Depthwise(Node start, Node end) {
Stack<Node> work = new Stack<Node> ();
List<Node> visited = new List<Node> ();