sequenceDiagram ExUnit.Runner->>+ExUnit.Server: {:take_async_modules, count} ExUnit.Server->>-ExUnit.Runner: [AsyncModule1Test, AsyncModule2Test, ...] ExUnit.Runner->>+ExUnit.EventManager: {:module_started, %ExUnit.TestModule{module: AsyncModule1Test}} ExUnit.EventManager->>+ExUnit.CLIFormatter: {:module_started, %ExUnit.TestModule{}} ExUnit.EventManager->>+CustomFormatter: {:module_started, %ExUnit.TestModule{}} loop Every test case ExUnit.Runner->>+ExUnit.EventManager: {:test_started, %ExUnit.Test{tags: t}} ExUnit.EventManager->>+ExUnit.CLIFormatter: {:test_started, %ExUnit.Test{tags: t}} ExUnit.EventManager->>+CustomFormatter: {:test_started, %ExUnit.Test{tags: t + c}}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule TestMem do | |
@moduledoc """ | |
JUnitFormatter that outputs memory usage to a file. | |
Useful to measure your test suite's memory consumption. | |
""" | |
use GenServer | |
@impl true | |
def init(_opts) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule AbsintheHelper do | |
@moduledoc """ | |
A way to `import_fields` from a specific module. | |
The idea is to make it more explicit in your schema where | |
object fields are coming from at a glance. | |
Usage in your schema: | |
``` | |
require AbsintheHelper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
import Foundation | |
// Move around and click automatically at random places in macos, kinda human like in a cheap way. | |
// Moves the mouse pointer to `moves` random locations on the screen and runs the `action` function at | |
// each point with the point as argument. | |
func mouseMoveWithAction(moves: Int, action: (CGPoint) -> Void = defaultAction) { | |
let screenSize = NSScreen.main?.visibleFrame.size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- functional programming utilities | |
-- usage: local fn = require "fn" | |
NAME = "fn" | |
local M = { } | |
-- Invokes the reducer function for each element in the collection with the accumulator. | |
-- The initial value of the accumulator is initial. The function is invoked for each | |
-- element in the enumerable with the accumulator. The result returned by the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show top memory using processes | |
:erlang.processes() | |
|> Enum.map(fn pid -> | |
:erlang.process_info(pid, [:memory, :current_function, :current_location]) | |
end) | |
|> Enum.sort_by(fn process_info -> process_info[:memory] end) | |
|> Enum.reverse() | |
|> Enum.take(25) | |
# show top memory using ETS tables |
I hereby claim:
- I am vorce on github.
- I am vorce (https://keybase.io/vorce) on keybase.
- I have a public key ASB3SC08McO8-tJmvv3Mg3UbfhXyQKHZi_xXORoKAxVukwo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn _henon [x y] | |
(let [x1 (* 1.4 (Math/pow x 2))] | |
[(+ y (- 1 x1)), (* x 0.3)])) | |
(defn henon [x y] | |
(let [[hx hy] (_henon x y)] | |
(lazy-seq (cons [hx hy] (henon hx hy))))) | |
; Example usage: (take 100 (henon 1 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns vorce.procedural.simplex) | |
; Direct translation of | |
; https://github.com/mikera/clisk/blob/develop/src/main/java/clisk/noise/Simplex.java | |
; to clojure. | |
; ...... friday night fun. | |
; Only supports 2d right now. | |
(defstruct grad :x :y :z :w) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns symmetri.core | |
(:use quil.core | |
raev.core)) | |
(def mid-x 400) | |
(def mid-y 300) | |
(defrecord Point [x y z]) | |
(defrecord Sym [s1 s2 col]) | |
(defrecord Colors [r g b a]) |
NewerOlder