Skip to content

Instantly share code, notes, and snippets.

View bbhoss's full-sized avatar
🎯
Focusing

Preston bbhoss

🎯
Focusing
View GitHub Profile
defmodule BasicBench do
use Benchfella
@list Enum.to_list(1..1000)
before_each_bench _ do
{:ok, Enum.to_list(1..5000)}
end
bench "prepend with ++" do
defmodule BasicBench do
use Benchfella
@list Enum.to_list(1..5000)
bench "prepend with ++" do
foo = [99] ++ @list
Enum.reverse foo
end
defmodule BasicBench do
use Benchfella
@list Enum.to_list(1..1000)
bench "++" do
foo = @list ++ @list
Enum.reverse foo
end
@bbhoss
bbhoss / iex-truncate.el
Created September 8, 2015 22:16
How to truncate Alchemist's iex output
(add-hook 'alchemist-iex-mode-hook
((lambda ()
(add-hook 'comint-output-filter-functions 'comint-truncate-buffer)
(setq comint-buffer-maximum-size 5000
comint-scroll-show-maximum-output t))))
comint-output-filter-functions is a variable defined in `comint.el'.
Its value is
(sml/generate-buffer-identification ansi-color-process-output comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt)
This variable's value is permanent if it is given a local binding.
This variable may be risky if used as a file-local variable.
Documentation:
Functions to call after output is inserted into the buffer.
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
comint-output-filter-functions is a variable defined in `comint.el'.
Its value is (comint-truncate-buffer . comint-truncate-buffer)
This variable's value is permanent if it is given a local binding.
This variable may be risky if used as a file-local variable.
Documentation:
Functions to call after output is inserted into the buffer.
One possible function is `comint-postoutput-scroll-to-bottom'.
These functions get one argument, a string containing the text as originally
use Mix.Config
# Stop lager redirecting :error_logger messages
config :lager, :error_logger_redirect, false
# Stop lager removing Logger's :error_logger handler
config :lager, :error_logger_whitelist, [Logger.ErrorHandler]
# Stop lager writing a crash log
config :lager, :crash_log, false
# Use LagerLogger as lager's only handler.
config :lager, :handlers, [{LagerLogger, [level: :debug]}]
(require 'smartparens)
(sp-with-modes '(elixir-mode)
(sp-local-pair "fn" "end"
:when '(("SPC" "RET"))
:actions '(insert navigate))
(sp-local-pair "do" "end"
:when '(("SPC" "RET"))
:post-handlers '(sp-ruby-def-post-handler)
:actions '(insert navigate)))
{
"schedule": "R\/2014-09-25T17:22:00Z\/PT2M",
"name": "dockerjob",
"container": {
"type": "DOCKER",
"image": "libmesos/ubuntu",
},
"cpus": "0.5",
"mem": "512",
"command": "while sleep 10; do date =u %T; done"