Skip to content

Instantly share code, notes, and snippets.

Marcos Pereira marcospereira

Block or report user

Report or block marcospereira

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
marcospereira / github-notifications.js
Created Mar 25, 2019
GitHub Notifications By Organizations
View github-notifications.js
// ==UserScript==
// @name GitHub Notifications By Organizations
// @namespace
// @version 1.0
// @description Group the notifications list by organizations
// @author marcospereira
// @match
// @include*/notifications
// @license MIT
// @grant none
marcospereira / blocked-thread.txt
Created Nov 15, 2018
Deadlock when using runProd and kill
View blocked-thread.txt
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 |
| Frozen for at least 10s |
| | |
View gist:31e7383e3f9bed8ffc3577921ef5c693

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)


marcospereira / Vagrantfile
Created Oct 23, 2017
Simple Vagrant file to create a Ubuntu 16.04 box
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config| = "ubuntu/xenial64" "forwarded_port", guest: 80, host: 8080 "forwarded_port", guest: 9000, host: 9090
config.vm.provider "virtualbox" do |vb|
marcospereira / output.log
Created Sep 25, 2017
Gradle error ouput when running ./gradlew :platformPlay:check
View output.log
> 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(
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
marcospereira /
Last active May 4, 2017
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());
View ResetDbSpec.scala
trait ResetDbSpec extends PlaySpec with BeforeAndAfterAll {
private def withTestDatabase[T](block: Database => T) = {
driver = "com.mysql.jdbc.Driver",
url = "jdbc:mysql://localhost/test",
name = "mydatabase",
config = Map(
"user" -> "test",
"password" -> "secret"
marcospereira / thread.dump
Created Feb 9, 2017
Thread dump after running tests without forking
View thread.dump
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(
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(
marcospereira / compiler-stacktrace.txt
Created Jan 13, 2017
Weird error while compiling Play code
View compiler-stacktrace.txt
[warn] an unexpected type representation reached the compiler backend while compiling HttpRequestHandler.scala: <error>. If possible, please file a bug on
scala.MatchError: <error> (of class scala.reflect.internal.Types$ErrorType$)
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)
marcospereira / Application.scala
Created Feb 27, 2016
Play controller using a custom logger
View Application.scala
package controllers
import play.api.Logger
import play.api.mvc._
class Application extends Controller {
lazy val logger = Logger(classOf[Application])
def index = Action { implicit request =>
You can’t perform that action at this time.