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
| class Post < ActiveRecord::Base | |
| attr_accessible :body, :price, :title | |
| validates_presence_of :title | |
| validates_length_of :title, minimum: 10 | |
| validates_presence_of :body | |
| validates_numericality_of :price, greater_than: 0 | |
| 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 'net/http' | |
| def post_xml url_string, xml_string | |
| uri = URI.parse url_string | |
| request = Net::HTTP::Post.new uri.path | |
| request.body = xml_string | |
| request.content_type = 'text/xml' | |
| response = Net::HTTP.new(uri.host, uri.port).start { |http| http.request request } | |
| response.body | |
| 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
| /** | |
| * Stand alone polyfill allow only numbers on input of type number. | |
| * | |
| * While input filtering is already supported by default by some browsers, maximum length has not been implemented by | |
| * any. This script will solve both issue and make sure that only digits can be entered in input elements of type | |
| * number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on | |
| * input of type text. | |
| * | |
| * Supports: | |
| * |
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
| Run this command to install MG-CLI: | |
| sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb | |
| to start miner (4 cores for BCN) use this command: | |
| minergate-cli -user <YOUR@EMAIL.KAPPA> -bcn 4 | |
| Feel free to send some of your earnings to me: | |
| BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j |
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 Solution do | |
| #Enter your code here. Read input from STDIN. Print output to STDOUT | |
| def read do | |
| case IO.read(:stdio, :line) do | |
| :eof -> :ok | |
| {:error, reason} -> IO.puts "Error: #{reason}" | |
| data -> | |
| IO.write(:stdio, "Hello, World. \n") | |
| IO.write(:stdio, data) | |
| read() |
OlderNewer