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 File.join(File.dirname(__FILE__), "../lib/diffie_hellman") | |
| curve = Ecc::Curve.new 324, 1287, 3851 | |
| point = Ecc::Point.new 920, 303 | |
| server = Ecc::DiffieHellman.new curve, point, 1194 | |
| client = Ecc::DiffieHellman.new curve, point, 1759 | |
| server_pub = server.computePublicKey() | |
| puts "Server Public Key: #{server_pub}" |
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
| #openssl | |
| require 'openssl' | |
| require 'base64' | |
| require "digest" | |
| include OpenSSL | |
| def aes256_encrypt(key, data) | |
| key = Digest::SHA256.digest(key) if(key.kind_of?(String) && 32 != key.bytesize) | |
| aes = OpenSSL::Cipher.new('AES-256-CBC') | |
| aes.encrypt |
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 'google/api_client' | |
| require 'google/api_client/client_secrets' | |
| require 'google/api_client/auth/installed_app' | |
| class User < ActiveRecord::Base | |
| def save_google_credentials(omniauth, params) | |
| if omniauth["credentials"]["refresh_token"] | |
| self.google_access_token = omniauth["credentials"]["token"] |
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
| puts "hello ruby :-)" |
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
| ls -lah hello.rb |
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 'mobile/mobile_helper' | |
| describe 'TaskOperations', type: :request, focus: false do | |
| before(:each) do | |
| @account = FactoryGirl.create(:account_with_admin) | |
| @location = @account.locations.first | |
| @admin = FactoryGirl.create(:admin, loc_id: @location.id, account_id: @account.id) | |
| param = FactoryGirl.attributes_for(:patient, loc_id: @location.id, account: @account, email: '[email protected]') | |
| @patient = create_user(param, @account, @admin, 'Patient') |
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
| sudo apt-get update | |
| \curl -sSL https://get.rvm.io | bash -s stable | |
| sudo apt-get -y install postgresql postgresql-contrib libpq-dev | |
| touch ~/.gemrc | |
| echo 'install: --no-rdoc --no-ri' >> ~/.gemrc | |
| gem install bundler --prerelease | |
| gem install rails | |
| rails new . -d postgresql |
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
| <div class="row"> | |
| <div class="col m8 offset-m2"> | |
| <% if @task.video_url.present? %> | |
| <div class="card z-depth-2"> | |
| <div class="card-image waves-effect waves-block waves-light"> | |
| <div class="center"> | |
| <iframe width="100%" height="315" src="<%= @task.video_url %>" frameborder="0" allowfullscreen></iframe> | |
| </div> | |
| </div> | |
| </div> |
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
| <div class="row"> | |
| <br/> | |
| <% @courses.each do |course| %> | |
| <%= link_to course do %> | |
| <div class="col s12 m6"> | |
| <div class="card"> | |
| <div class="card-image waves-effect waves-block waves-light"> | |
| <%= image_tag course.image.url %> | |
| </div> | |
| <div class="card-content"> |
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
| version: 2 | |
| jobs: | |
| build: | |
| working_directory: ~/circleci-demo-ruby-rails | |
| docker: | |
| - image: circleci/ruby:2.4.1-node | |
| environment: | |
| RAILS_ENV: test | |
| PGHOST: 127.0.0.1 | |
| PGUSER: root |