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
#MORSE CODE GENERATOR | |
#ENTER A MESSAGE AND PRESS RUN | |
message = 'Morse code is old' | |
#CUSTOMIZE | |
words_per_minute = 18 # slow:12, standard: 18, fast: 24 | |
@u = 1.2 / words_per_minute #One time unit (length of 1 dot) | |
@looped = true #comment out to play message only once | |
@pitch = 83 |
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
<%= pgtitle @lesson %> | |
<%= description @lesson.meta_description.presence || @lesson.description.presence %> | |
<div class="lesson"> | |
<%= section class: "lesson-header" do %> | |
<div class="lesson-icon-wrapper"> | |
<div class="lesson-icon"> | |
<%= image_tag @lesson.icon %> |
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 'spec_helper' | |
feature "AgencyOffice" do | |
let(:agency) { create(:agency) } | |
scenario "makes agency visible on relevant country page" do | |
visit country_path(agency.offices.first.country) | |
expect(page).to have_content agency.name |
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
# Gengo provides an API to their human translation service | |
# https://gengo.com/developers/ | |
class GengoTranslation | |
require 'gengo' | |
attr_accessor :gengo | |
def initialize(sandbox: false) | |
sandbox = true unless Rails.env.production? |
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
# Selecting a photo to upload shows photo and filename instantly | |
placeSelectedPhotoPreview = (input) -> | |
if input.files && input.files[0] | |
reader = new FileReader() | |
reader.readAsDataURL(input.files[0]) | |
reader.onload = (e) -> | |
$(input).closest('.thumbnail').find('img#photo-preview').attr("src", e.target.result) | |
$(input).closest('.thumbnail').find("#upload-filename").html(input.files[0].name) | |
# When a photo is selected |