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 id="video"> | |
<video type='framebase' data-video='f4ad2fdf-d272-481e-9c9a-904fcf182404' width="500" height="400"></video> | |
</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
require 'rubygems' | |
require 'google_calendar' | |
require 'awesome_print' | |
require 'date' | |
require 'time' | |
cal = Google::Calendar.new(:username => '[email protected]', | |
:password => 'awesome_password_of_lore', | |
:app_name => 'CDS Calendar') |
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
1.9.3p194 :009 > message.api.request(:get, message.body_parts.resource_url) | |
=> [{"type"=>"text/plain", "charset"=>"utf-8", "content"=>"X applied to the Y position posted on Indeed. You will find their information below and resume attached (if one was provided).\r\n\r\nhttps://employers.indeed.com/m#candidates/view?id=Z\r\n\r\nName: X\r\nEmail:Y\r\nNote: the attached resume has not been scanned for viruses, be careful when opening attachments.", "body_section"=>"1.1"}, {"type"=>"text/html", "charset"=>"utf-8", "content"=>"<!doctype html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"></head><body style=\"line-height:16px;font-family:Arial,sans-serif\"><div style=\"width:500px;margin:0 0 10px 0;font-size:12px;padding-left:10px\"><div><img src=\"https://ads.indeed.com/images/email/indeed-logo-small.png\"/></div><div style=\"margin:10px;\"><div style=\"color:#666666\">You've received a new application for the job:</div><div style=\"margin-top:3px;font-weight:bold;\">X - Houston, |
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
product.images << ShopifyAPI::Image.new({:src => "http://c0009431.cdn.cloudfiles.rackspacecloud.com/pad-a-cheek-mask-straps-pair-top.jpg"}) | |
product.save |
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 'data_mapper' | |
DataMapper.setup(:default, ENV['SHARED_DATABASE_URL'] || "sqlite3://#{Dir.pwd}/development.db") | |
class Text | |
include DataMapper::Resource | |
property :id, Serial | |
property :email, String | |
property :full_text, String | |
property :phone, String |
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
# Resource called by the Tropo WebAPI URL setting | |
post '/index.json' do | |
# Fetches the HTTP Body (the session) of the POST and parse it into a native Ruby Hash object | |
v = Tropo::Generator.parse request.env["rack.input"].read | |
# Fetching certain variables from the resulting Ruby Hash of the session details | |
# into Sinatra/HTTP sessions; this can then be used in the subsequent calls to the | |
# Sinatra application | |
session[:from] = v[:session][:from] |
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
in a rails app... | |
1. Paste this into the bottom of your gemfile | |
source "http://gems.github.com" | |
gem 'contextio', :git => 'git://github.com/contextio/Ruby-ContextIO.git', :branch => 'dev_2.0' | |
2. Bundle install per usual |
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
1. CLI: | |
Admins-MacBook-Pro:gemtest johnnygoodman$ rvm gemset create contextio | |
'contextio' gemset created (/usr/local/rvm/gems/ruby-1.9.3-p194@contextio). | |
Admins-MacBook-Pro:gemtest johnnygoodman$ rvm gemset use contextio | |
Using ruby-1.9.3-p194 with gemset contextio | |
Admins-MacBook-Pro:gemtest johnnygoodman$ touch Gemfile | |
Admins-MacBook-Pro:gemtest johnnygoodman$ touch app.rb | |
Admins-MacBook-Pro:gemtest johnnygoodman$ mate . | |
Admins-MacBook-Pro:gemtest johnnygoodman$ bundle install |
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
connection = ContextIO::Connection.new(key, secret) | |
puts connection.methods | |
all_messages | |
all_files | |
addresses | |
contact_search | |
contact_files | |
contact_messages |
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 'oauth' | |
require 'net/http' | |
module ContextIO | |
VERSION = "2.0" | |
class ContextIO::Connection | |
def initialize(key='', secret='', server='https://api.context.io') | |
@consumer = OAuth::Consumer.new(key, secret, {:site => server, :sheme => :header}) | |
@token = OAuth::AccessToken.new @consumer |