Skip to content

Instantly share code, notes, and snippets.

View SpencerCooley's full-sized avatar

Spencer Cooley SpencerCooley

View GitHub Profile
//add an event listener to the black marker
google.maps.event.addListener(marker,'click', function(){
infowindow.open(map, marker);
});
Invalid .gemspec format in '/var/lib/gems/1.8/specifications/therubyracer-0.9.7.gemspec'
sudo aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
group :production do
gem 'pg'
end
#used this in my gemfile, and used the cedar stack.
#also had to precompile the assets before you commit.
# $ bundle exec rake assets:precompile
$(document).ready(function(){
function randomFromTo(from, to){
return Math.floor(Math.random() * (to - from + 1) + from);
}
var randomnumber= randomFromTo(2,5);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<!doctype html>
<html>
<head>
<style>
@media print{
@page {size: landscape}
#wrap_invoice{
<div id="wrap_invoice">
<table>
<tr>
<td width="400"><!--replace this text with variables-->John Smith</td>
<td><!--replace this text with variables-->$1.46</td>
</tr>
<tr>
#typical smtp_settings for gmail account
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "domain.of.sender.net",
:authentication => "plain"
:user_name => "spencecooley"
:password => "secret"
:enable_starttls_auto => true
}
class Notifier < ActionMailer::Base
default :from => "Sam Ruby <[email protected]>"
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.notifier.order_recieved.subject
#
def order_recieved
@greeting = "Hi"
require 'test_helper'
class NotifierTest < ActionMailer::TestCase
test "order_recieved" do
mail = Notifier.order_recieved
assert_equal "Order recieved", mail.subject
assert_equal ["[email protected]"], mail.to
assert_equal ["[email protected]"], mail.from
assert_match "Hi", mail.body.encoded
end