Skip to content

Instantly share code, notes, and snippets.

@john-eevee
john-eevee / metals.log
Created November 28, 2018 16:33
semanticdb unresolved
warn  Unable to automatically connect to build server.
info  running 'sbt metalsEnable bloopInstall'
error Getting org.scala-sbt sbt 1.2.1 (this may take some time)...
info  downloading https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.jar ...
info  [SUCCESSFUL ] org.scala-sbt#sbt;1.2.1!sbt.jar (1216ms)
info  downloading https://repo1.maven.org/maven2/org/scala-sbt/main_2.12/1.2.1/main_2.12-1.2.1.jar ...
info  [SUCCESSFUL ] org.scala-sbt#main_2.12;1.2.1!main_2.12.jar (6509ms)
info  downloading https://repo1.maven.org/maven2/org/scala-sbt/logic_2.12/1.2.1/logic_2.12-1.2.1.jar ...
info  [SUCCESSFUL ] org.scala-sbt#logic_2.12;1.2.1!logic_2.12.jar (883ms)
info  downloading https://repo1.maven.org/maven2/org/scala-sbt/actions_2.12/1.2.1/actions_2.12-1.2.1.jar ...
import akka.actor.ActorRef;
import akka.dispatch.*;
import org.jctools.queues.MpscArrayQueue;
/**
* Non-blocking, multiple producer, single consumer high performance bounded message queue,
* this implementation is similar but simpler than LMAX disruptor.
*/
public final class MpscBoundedMailbox implements MessageQueue {
@john-eevee
john-eevee / app.scala
Created October 24, 2018 20:53
consume and reply to twitch ping message
package trolltracer
import akka.actor.ActorSystem
import akka.http.scaladsl.model.ws._
import akka.http.scaladsl.Http
import akka.stream.{ActorMaterializer, BidiShape}
import akka.stream.scaladsl.{
Flow,
GraphDSL,
Keep,
Merge,
@john-eevee
john-eevee / observer.md
Created October 24, 2018 03:18 — forked from pnc/observer.md
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@john-eevee
john-eevee / chat.ex
Created October 22, 2018 18:31
not working chat, idk for future reference
defmodule Engag.ChatFeed do
alias :gun, as: Gun
@type message :: {:text, iodata()}
@type channel :: String.t()
def connect(nickname, token) do
with {:ok, conn} <- http(),
{:ok, _protocol} <- Gun.await_up(conn),
_ref <- upgrade(conn),
@john-eevee
john-eevee / .editorconfig
Last active October 18, 2018 16:33
scala project common files
# http://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
max_line_length = 80
using local
# input ... converter ... list of files ....
given fasta_files('influenza.fasta', 'influenza_2.fasta') do
# ... ops ....
align by pair
# .... execute file passing context ....
exec './myscript.py'
# ..... generate a report or plot
report
end
@john-eevee
john-eevee / build.gradle.kts
Last active September 19, 2018 17:32
Gradle Kotlin DSL for ktor
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "com.github.sleepiejohn"
version = "1.0-SNAPSHOT"
plugins {
kotlin("jvm") version "1.3-M2"
application
}
@john-eevee
john-eevee / elixir.json
Last active August 24, 2018 04:25
VSCode Elixir Snippets
{
"Module definition": {
"prefix": "mod",
"body": [
"defmodule $1 do",
" $0",
"end"
]
},
"Function definition": {
@john-eevee
john-eevee / .formatter.exs
Created June 11, 2018 05:22
Elixir formatter for Phoenix without parentheses
[
  inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"],
  locals_without_parens: [
# Kernel
    inspect: 1,