This file contains hidden or 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
| require "virtus" | |
| require "rspec" | |
| class Test | |
| include Virtus.model(:nullify_blank => true) | |
| attribute :name, String | |
| end | |
| RSpec.describe Test do | |
| it "should be nil" do | |
| test = Test.new(name: "") |
This file contains hidden or 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
| Generated elixir_stream_phoenix.app | |
| [info] Running ElixirStreamPhoenix.Endpoint with Cowboy on port 4000 (http) | |
| 21 Apr 00:10:12 - info: compiled 26 files into 2 files in 894ms | |
| [info] GET / | |
| [info] Processing by ElixirStreamPhoenix.PageController.index/2 | |
| Parameters: %{"format" => "html"} | |
| Pipelines: [:browser] | |
| [info] Sent 200 in 27ms | |
| [info] GET / | |
| [info] Processing by ElixirStreamPhoenix.PageController.index/2 |
This file contains hidden or 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
| require 'classifier' | |
| require 'simple-rss' | |
| require 'open-uri' | |
| require "pry" | |
| b = Classifier::Bayes.new 'artur', 'janis' | |
| janis_rss = SimpleRSS.parse open('http://codingwithaxe.com/rss') | |
| janis_rss.items.take(5).each do |i| |
This file contains hidden or 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
| ➜ phoenix_pubsub mix test | |
| Compiled lib/phoenix_pubsub.ex | |
| Compiled lib/pubsub/pg2.ex | |
| Compiled lib/pubsub/redis.ex | |
| Compiled lib/pubsub/redis_conn.ex | |
| Compiled lib/pubsub/pg2_server.ex | |
| Compiled lib/pubsub/redis_server.ex | |
| Compiled lib/pubsub/local.ex | |
| Compiled lib/pubsub.ex | |
| Generated phoenix_pubsub.app |
This file contains hidden or 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 Hello do | |
| def start do | |
| hello = function_1 | |
| function_2(hello) | |
| function_1 |> | |
| function_2 | |
| end |
This file contains hidden or 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
| require "json" | |
| require "rspec" | |
| require "date" | |
| json_data = <<-JSON | |
| {"activities": [ | |
| { | |
| "captured_at": 1392366463, | |
| "distance": "1.12", | |
| "duration": 12, |
This file contains hidden or 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
| require "json" | |
| require "rspec" | |
| json_data = <<-JSON | |
| {"activities": [ | |
| { | |
| "captured_at": 1392366463, | |
| "distance": "1.12", | |
| "duration": 12, | |
| "calories": 100 |
This file contains hidden or 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
| nmap <Up> :!x-www-browser "http://www.youtube.com/watch?v=dQw4w9WgXcQ"<CR> | |
| nmap <Down> :!x-www-browser "http://www.youtube.com/watch?v=dQw4w9WgXcQ"<CR> | |
| nmap <Left> :!x-www-browser "http://www.youtube.com/watch?v=dQw4w9WgXcQ"<CR> | |
| nmap <Right> :!x-www-browser "http://www.youtube.com/watch?v=dQw4w9WgXcQ"<CR> |
This file contains hidden or 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
| ==> mix (exunit) | |
| ....................................................... | |
| 1) test prints list of dependencies and their lock status (Mix.Tasks.DepsTest) | |
| ** (MatchError) no match of right hand side value: [""] | |
| stacktrace: | |
| lib/mix/scm/git.ex:132: Mix.SCM.Git.get_rev_info/0 | |
| lib/mix/scm/git.ex:32: Mix.SCM.Git."-lock_status/1-fun-0-"/4 | |
| /home/janjiss/elixir/lib/elixir/lib/file.ex:913: File.cd!/2 | |
| lib/mix/deps.ex:273: Mix.Deps.check_lock/2 |
This file contains hidden or 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
| aa |