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
# .github/workflows/ci.yml | |
name: CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:11 |
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 Appointment < ApplicationRecord | |
# .. this model is long and has many lines of code, so we cut it where it's important :-D | |
phony_normalize :phone, :default_country_code => 'US', :add_plus => true | |
# Associations | |
has_many :appointment_call_logs, dependent: :destroy | |
has_many :call_logs, through: :appointment_call_logs, source: :call_log | |
has_one :masked_number, as: :callable | |
#callbacks |
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 'oauth2' | |
require 'json' | |
module ZohoServices | |
class Invoice | |
attr_reader :oauth_auth_code, :client | |
def initialize | |
@customer_id = "CUSTOMER_ID" # define this customer_id | |
@query_root = "https://invoice.zoho.com/api/v3" |
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
function checkSoldOut() { | |
if ($('#SingleOptionSelector-0').val() == 'Large') { | |
$( "<div id='email_when_available' style='padding: 0 5px;'><button style='color: #fff; background-color: #900; width: 100%; '>EMAIL WHEN AVAILABLE</button></div>" ).insertAfter( ".product-form" ) | |
} else { | |
$('#email_when_available').remove() | |
} | |
} | |
$('#SingleOptionSelector-0').on('change', function() { | |
checkSoldOut() |
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
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 |
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
<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 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 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 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 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 |
NewerOlder