Skip to content

Instantly share code, notes, and snippets.

View marcospereira's full-sized avatar
🏠
Working from home

Marcos Pereira marcospereira

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am marcospereira on github.
  • I am marcospereira (https://keybase.io/marcospereira) on keybase.
  • I have a public key whose fingerprint is 9C9C C049 50FF 6AE4 A2A1 C08A F7EB B0FF 122A 3D87

To claim this, I am signing this object:

@marcospereira
marcospereira / github-notifications.js
Created March 25, 2019 16:22
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
// @license MIT
// @grant none
@marcospereira
marcospereira / blocked-thread.txt
Created November 15, 2018 23:14
Deadlock when using runProd and kill
Potential deadlock: frozen threads found
It seems that the following threads have not changed their stack for more than 10 seconds.
These threads are possibly (but not necessarily!) in a deadlock or hung.
+------------------------------------------------------------------------------------------------------------------------------------------+
| Name |
+------------------------------------------------------------------------------------------------------------------------------------------+
| +---application-akka.actor.default-dispatcher-2 Frozen for at least 10s |
| | |

First run

openjdk version "1.8.0-adoptopenjdk"
OpenJDK Runtime Environment (build 1.8.0-adoptopenjdk-jenkins_2018_05_19_02_01-b00)
OpenJDK 64-Bit Server VM (build 25.71-b00, mixed mode)

Error:

@marcospereira
marcospereira / Vagrantfile
Created October 23, 2017 18:55
Simple Vagrant file to create a Ubuntu 16.04 box
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 9000, host: 9090
config.vm.provider "virtualbox" do |vb|
@marcospereira
marcospereira / output.log
Created September 25, 2017 20:37
Gradle error ouput when running ./gradlew :platformPlay:check
> Task :platformPlay:test
java.lang.UnsatisfiedLinkError: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libnio.dylib: dlopen(/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libnio.dylib, 1): no suitable image found. Did find:
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libnio.dylib: open() failed with errno=23
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at sun.nio.ch.IOUtil$1.run(IOUtil.java:360)
at sun.nio.ch.IOUtil$1.run(IOUtil.java:357)
@marcospereira
marcospereira / Foo.java
Last active May 4, 2017 18:12
Play internals to handle a request.
public class Foo {
public static void main(String[] args) {
play.Environment env = play.Environment.simple();
play.ApplicationLoader.Context context = play.ApplicationLoader.create(env);
// Keep in mind that plays expects that configuration
// play.application.loader is defined. Otherwise an error
// is raised.
play.api.ApplicationLoader loader = play.api.ApplicationLoader$.MODULE$.apply(context.underlying());
trait ResetDbSpec extends PlaySpec with BeforeAndAfterAll {
private def withTestDatabase[T](block: Database => T) = {
Databases.withDatabase(
driver = "com.mysql.jdbc.Driver",
url = "jdbc:mysql://localhost/test",
name = "mydatabase",
config = Map(
"user" -> "test",
"password" -> "secret"
)
@marcospereira
marcospereira / thread.dump
Created February 9, 2017 21:31
Thread dump after running tests without forking
2017-02-09 13:30:19
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode):
"AsyncAppender-Worker-ASYNCSTDOUT" #619 daemon prio=5 os_prio=31 tid=0x00007fa1d1d36800 nid=0x19b0b waiting on condition [0x000070001af19000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007749ceab0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
@marcospereira
marcospereira / compiler-stacktrace.txt
Created January 13, 2017 17:08
Weird error while compiling Play code
[warn] an unexpected type representation reached the compiler backend while compiling HttpRequestHandler.scala: <error>. If possible, please file a bug on issues.scala-lang.org.
scala.MatchError: <error> (of class scala.reflect.internal.Types$ErrorType$)
at scala.tools.nsc.backend.jvm.BTypesFromSymbols.typeToBType(BTypesFromSymbols.scala:212)
at scala.tools.nsc.backend.jvm.BTypesFromSymbols.$anonfun$methodBTypeFromMethodType$1(BTypesFromSymbols.scala:147)
at scala.tools.nsc.backend.jvm.BTypesFromSymbols.methodBTypeFromMethodType(BTypesFromSymbols.scala:147)
at scala.tools.nsc.backend.jvm.BTypesFromSymbols.methodBTypeFromSymbol(BTypesFromSymbols.scala:137)
at scala.tools.nsc.backend.jvm.BTypesFromSymbols.$anonfun$buildInlineInfoFromClassSymbol$5(BTypesFromSymbols.scala:583)
at scala.collection.Iterator$$anon$11.nextCur(Iterator.scala:473)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:479)
at scala.collection.Iterator.foreach(Iterator.scala:929)