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 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() |
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
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 <[email protected]> -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 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 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 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 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
module AmazonSignature | |
extend self | |
def signature | |
Base64.encode64( | |
OpenSSL::HMAC.digest( | |
OpenSSL::Digest.new('sha1'), | |
AWS_CONFIG['secret_access_key'], self.policy | |
) | |
).gsub("\n", "") |
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
upstream project { | |
server unix:///home/deploy/apps/avtomat_kalashnikova/shared/tmp/sockets/avtomat_kalashnikova-puma.sock; | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
root /home/deploy/apps/avtomat_kalashnikova/current/public; | |
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
upstream puma { | |
server unix:///home/deploy/apps/avtomat_kalashnikova/shared/tmp/sockets/avtomat_kalashnikova-puma.sock; | |
} | |
server { | |
listen 80 default_server deferred; | |
# server_name example.com; | |
root /home/deploy/apps/avtomat_kalashnikova/current/public; | |
access_log /home/deploy/apps/avtomat_kalashnikova/current/log/nginx.access.log; |
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
1. Clone the Repo and Add to User Directory | |
1 | |
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) | |
This command uses cURL to grab the GitHub repo and install it into your user directory. The file that this repo is placed in is ~/.gvm. | |
2. Open Your ~/.bashrc and Source the GVM Directory | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>My Rails App</title> | |
<%- if protect_against_forgery? -%> | |
<meta name="authenticity-token" id="authenticity-token" content="<%= form_authenticity_token %>" /> | |
<%- end -%> | |
<%= javascript_include_tag 'jquery', 'rails' %> | |
</head> | |
<body> |
NewerOlder