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
| function sendEmails() { | |
| // Get the main data // getRange(row, column, numRows, numColumns) | |
| var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("DatesOfDuty") | |
| var lastRow = sheet.getLastRow(); | |
| var data = sheet.getRange(2, 1,lastRow, 4).getValues(); | |
| // Other variables | |
| var instructions = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("MessageToSend").getRange(1,1).getValues(); | |
| var daysBeforeToSend = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("MessageToSend").getRange(2,6).getValues(); | |
| var EMAIL_SENT = 'EMAIL_SENT'; |
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
| module AbeviationToState | |
| def self.find_state(abreviation) | |
| STATES_HASH[abreviation] | |
| end | |
| STATES_HASH = { | |
| 'AL' => 'Alabama', | |
| 'AK' => 'Alaska', | |
| 'AZ' => 'Arizona', |
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 "Rock, Paper, Scissors, shoot!" | |
| puts "(enter your choice)" | |
| user_choice = gets.chomp.downcase | |
| choices = ["rock", "paper", "scissors"] | |
| computer_choice = choices[rand(3)] | |
| puts "The computer chooses #{computer_choice}!" | |
| puts "Tie!" if user_choice == computer_choice |
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 "What year were your born?" | |
| birth_year = gets.chomp | |
| puts "What month were your born?" | |
| birth_month = gets.chomp | |
| puts "What day were your born?" | |
| birth_day = gets.chomp | |
| seconds_diff = Time.now - Time.new(birth_year, birth_month, birth_day) |
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 'rubygems' | |
| require 'dwolla' | |
| class User | |
| attr_accessor :dwolla_oauth_token, :encrypted_dwolla_pin | |
| def initialize(dwolla_oauth_token, pin) | |
| @dwolla_oauth_token = dwolla_oauth_token | |
| @pin = pin | |
| 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 'nokogiri' | |
| require 'open-uri' | |
| require 'csv' | |
| challenges = [] | |
| start_challenge_id = 1 | |
| end_challenge_id = 412 | |
| # Searches the given page for links and returns hash of result | |
| def challenge_record_from_page challenge_id |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
| <link rel="stylesheet" href="main.css"> | |
| <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
| <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
| <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
| </head> |
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
| //------------------------------------------------------------------------------------------------------------------ | |
| // YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
| //------------------------------------------------------------------------------------------------------------------ | |
| function Animal(name, legs){ | |
| this.name = name; | |
| this.legs = legs; | |
| }; | |
| Animal.prototype.identify = function(){ |
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
| $(document).ready(function () { | |
| $('body').on('click', '#roll_die', function(event) { | |
| event.preventDefault(); | |
| var die_number = Math.floor(Math.random()*6 + 1) | |
| var url = $('form').attr('action'); | |
| var new_image = '<img src="/' + die_number + '.png" ' + 'title="' + die_number + '" alt="the roll">' | |
| $.post(url, function(data){ | |
| $('#die img').remove() | |
| $('#die').append(new_image) |