Skip to content

Instantly share code, notes, and snippets.

~ $ ll /nix/var/nix/profiles/per-user/shosti/
total 1.0k
drwxr-xr-x 2 shosti users 3 2017-05-16 10:26 .
drwxrwxrwt 4 root root 4 2017-05-15 21:38 ..
-rw-r--r-- 1 shosti users 0 2017-05-16 10:26 profile
~ $ ll .nix-profile
lrwxrwxrwx 1 shosti users 45 2017-05-16 10:38 .nix-profile -> /nix/var/nix/profiles/per-user/shosti/profile
%{"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], []},
"cowboy": {:hex, :cowboy, "1.0.4", "a324a8df9f2316c833a470d918aaf73ae894278b8aa6226ce7a9bf699388f878", [:rebar, :make], [{:cowlib, "~> 1.0.0", [hex: :cowlib, optional: false]}, {:ranch, "~> 1.0", [hex: :ranch, optional: false]}]},
"cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], []},
"gettext": {:hex, :gettext, "0.12.1", "c0624f52763469ef7a3674919ae28b8286d88195b90fa1516180f31bbbd26d14", [:mix], []},
"mime": {:hex, :mime, "1.0.1", "05c393850524767d13a53627df71beeebb016205eb43bfbd92d14d24ec7a1b51", [:mix], []},
"phoenix": {:hex, :phoenix, "1.2.1", "6dc592249ab73c67575769765b66ad164ad25d83defa3492dc6ae269bd2a68ab", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, optional: false]}, {:plug, "~> 1.1", [hex: :plug, optional: false]}, {:poison, "~> 1.5 or ~
%{"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], []},
"cowboy": {:hex, :cowboy, "1.0.4", "a324a8df9f2316c833a470d918aaf73ae894278b8aa6226ce7a9bf699388f878", [:rebar, :make], [{:cowlib, "~> 1.0.0", [hex: :cowlib, optional: false]}, {:ranch, "~> 1.0", [hex: :ranch, optional: false]}]},
"cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], []},
"gettext": {:hex, :gettext, "0.12.1", "c0624f52763469ef7a3674919ae28b8286d88195b90fa1516180f31bbbd26d14", [:mix], []},
"mime": {:hex, :mime, "1.0.1", "05c393850524767d13a53627df71beeebb016205eb43bfbd92d14d24ec7a1b51", [:mix], []},
"phoenix": {:hex, :phoenix, "1.2.1", "6dc592249ab73c67575769765b66ad164ad25d83defa3492dc6ae269bd2a68ab", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, optional: false]}, {:plug, "~> 1.1", [hex: :plug, optional: false]}, {:poison, "~> 1.5 or ~
[info] Running Redistest.Endpoint with Cowboy using http://localhost:4000
[error] Disconnected from Redis (127.0.0.1:6379): TCP connection closed
[error] Disconnected from Redis (127.0.0.1:6379): TCP connection closed
[error] Disconnected from Redis (127.0.0.1:6379): TCP connection closed
[error] Disconnected from Redis (127.0.0.1:6379): TCP connection closed
[error] Disconnected from Redis (127.0.0.1:6379): TCP connection closed
[error] Disconnected from Redis (127.0.0.1:6379): TCP connection closed
[error] unable to establish initial redis connection. Attempting to reconnect...
[error] Failed to connect to Redis (127.0.0.1:6379): connection refused
[error] Failed to connect to Redis (127.0.0.1:6379): connection refused
defmodule Mocktest.Mocktest.Helpers do
import Mock
# Without this import, compilation fails
import ExUnit.Assertions, only: [assert: 1, assert: 2]
def stubbed_api_call do
with_mock HTTPoison, [get: fn(_url) -> "foo" end] do
# This could be in some internal library code, for example
HTTPoison.get("http://example.com")
end
(org-data nil
(section
(:begin 1 :end 79 :contents-begin 1 :contents-end 79 :post-blank 0 :post-affiliated 1 :parent #0)
(src-block
(:language "org" :switches nil :parameters nil :begin 1 :end 70 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :value " #+BEGIN_SRC haskell\n putStrLn \"HELLO\"\n" :post-blank 0 :post-affiliated 1 :parent #1))
(paragraph
(:begin 70 :end 79 :contents-begin 70 :contents-end 79 :post-blank 0 :post-affiliated 70 :parent #1)
#("#+END" 0 5
(:parent #2))
(subscript
NoMethodError: undefined method `-' for nil:NilClass
from /home/shosti/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/schema_validations-2.1.0/lib/schema_validations/active_record/validations.rb:111:in `block in load_column_validations'
from /home/shosti/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/schema_validations-2.1.0/lib/schema_validations/active_record/validations.rb:94:in `each'
from /home/shosti/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/schema_validations-2.1.0/lib/schema_validations/active_record/validations.rb:94:in `load_column_validations'
from /home/shosti/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/schema_validations-2.1.0/lib/schema_validations/active_record/validations.rb:88:in `load_schema_validations'
from /home/shosti/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/schema_validations-2.1.0/lib/schema_validations/active_record/validations.rb:6:in `load_schema_validations'
from /home/shosti/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/c
class Time
def self.nowish(x)
if x
raise 'Uh oh!'
else
self.now
end
end
end
~/src/rainforest/database_cleaner $ bundle exec rspec spec/database_cleaner/active_record/truncation/mysql2_spec.rb
Active Record 4.2.5, mysql2
-- create_table(:users, {:force=>true})
-> 0.0519s
-- create_table(:agents, {:id=>false, :force=>true})
-> 0.0468s
#truncate_table
should truncate the table (FAILED - 1)
(defun p-maybe-make-directory ()
"Create parent directory if not exists while visiting file."
(unless (file-exists-p buffer-file-name)
(let ((dir (file-name-directory buffer-file-name)))
(unless (file-exists-p dir)
(make-directory dir t)))))
(add-hook 'find-file-hook 'p-maybe-make-directory)