Skip to content

Instantly share code, notes, and snippets.

View ignasi35's full-sized avatar
🚧
Breaking CI builds since 2001

Ignasi Marimon-Clos ignasi35

🚧
Breaking CI builds since 2001
View GitHub Profile
package com.marimon.datastructures
// based on https://gist.github.com/alhuelamo/3f610055167301d4d2f2d32a954d4b18
sealed trait BST[+A] {
import BST._
def insert[AA >: A](
newValue: AA
)(implicit ordering: Ordering[AA]): BST[AA] = {
val res =
import subprocess
import argparse
# Copy/paste/adapted from https://raw.githubusercontent.com/lightbend/lb-demos/master/bin/network_tool.py
def get_deployment_pods(app_name, namespace):
lines = subprocess.check_output(['kubectl', 'get', 'pods', '-n', namespace, '--selector=app=' + app_name]).split("\n")
lines.pop(0) # pop header row
pods = []
for line in lines:
@ignasi35
ignasi35 / HelloreadSide.scala
Created February 21, 2020 08:49
Manually managed Lagom readside
class HelloreadSide extends ReadSideProcessor[HelloWorldEvent] {
override def aggregateTags: Set[AggregateEventTag[HelloWorldEvent]] =
Set(HelloWorldEvent.Tag.tag)
override def buildHandler()
: ReadSideProcessor.ReadSideHandler[HelloWorldEvent] = {
new ReadSideHandler[HelloWorldEvent] {
override def globalPrepare(): Future[Done] = Future.successful(Done)
// Returns the last Offset processed by this readside processor.
override def prepare(
package example
// Based on https://gist.github.com/412b/b383f0864c9dd4378ce22d616c694d64 which is part of https://github.com/akka/akka/pull/27309
import java.security.MessageDigest
import java.util.Base64
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations.{
OutputTimeUnit,
@ignasi35
ignasi35 / kill-zoom-server.sh
Last active July 9, 2019 16:33
Kill the Zoom server
#!/usr/bin/env bash
## Based on recommendations in https://medium.com/@jonathan.leitschuh/zoom-zero-day-4-million-webcams-maybe-an-rce-just-get-them-to-visit-your-website-ac75c83f4ef5
## Kills the HTTP server started by Zoom in localhost
## The HTTP server is restarted every every time Zoom runs but it
## is not necessary to participate or host in calls. Start Zoom and kill the server immediately after.
echo "-----------------"
echo "Is ZOOM server running?"
lsof -i :19421
@ignasi35
ignasi35 / mark-as-read.js
Created April 17, 2019 14:54
WIP - tampermokey to mark all closed as read on GH Notifications
// ==UserScript==
// @name GitHub Notifications - Mark all closed
// @namespace https://github.com
// @version 1.0
// @description Mark closed issues, closed PRs and merged PRs as read
// @author ignasi35
// @match https://github.com/notifications
// @include https://github.com/*/notifications
// @include https://github.com/notifications/*
// @license MIT
@ignasi35
ignasi35 / github-notifications.js
Last active April 3, 2019 13:23 — forked from marcospereira/github-notifications.js
GitHub Notifications By Organizations
// ==UserScript==
// @name GitHub Notifications By Organizations
// @namespace https://github.com
// @version 1.0
// @description Group the notifications list by organizations
// @author marcospereira
// @match https://github.com/notifications
// @include https://github.com/*/notifications
// @include https://github.com/notifications/*
// @license MIT
@ignasi35
ignasi35 / lagom-exitJvm-on-downing.txt
Created November 20, 2018 19:49
Deadlock on Lagom 1.5.0-RC1 using `exit-jvm` when Downing.
2018-11-20 20:48:46
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.172-b11 mixed mode):
"JMX server connection timeout 67" #67 daemon prio=9 os_prio=31 tid=0x00007f9c02216000 nid=0x6e07 in Object.wait() [0x00007000115a0000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(ServerCommunicatorAdmin.java:168)
- locked <0x000000076c7dcd98> (a [I)
at java.lang.Thread.run(Thread.java:748)
@ignasi35
ignasi35 / .bash_profile
Created September 21, 2018 08:38
Personal notes for bash profile
# Add Homebrew `/usr/local/bin` and User `~/bin` to the `$PATH`
PATH=/usr/local/bin:$PATH
PATH=$HOME/bin:$PATH
export PATH
# Load the shell dotfiles, and then some:
# * ~/.path can be used to extend `$PATH`.
# * ~/.extra can be used for other settings you don’t want to commit.
for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do
[ -r "$file" ] && source "$file"
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api
import java.util.concurrent.atomic.AtomicReference
import akka.Done
import akka.actor.CoordinatedShutdown