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
projects = new Usergrid.Collection({ | |
"client": client, | |
"type": "books", | |
"qs": { ql:'order by title asc', limit: 999} | |
}); | |
projects.fetch(function() { | |
// Save to local storage | |
localStorage.setItem('books', projects.serialize()); | |
}) |
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
var express = require('express'); | |
var request = require('request') | |
var app = express(); | |
app.all('/books*', function(req, res) { | |
request('https://api.usergrid.com/tim/sandbox'+req.url, function(err, result, usergridBody) { | |
try { | |
usergridObject = JSON.parse(usergridBody) | |
isbn = usergridObject.entities[0].isbn; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Camera Example</title> | |
<script src="cordova.js"></script> | |
<script src="https://apigee.com/usergrid/sdk/usergrid.0.10.5.js"></script> | |
<script type="text/javascript"> | |
document.addEventListener("deviceready", onDeviceReady, false); | |
function onDeviceReady() { |
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
var apigee = new Usergrid.Client({ | |
orgName:'YOUR APIGEE.COM USERNAME', | |
appName:'sandbox' | |
}); | |
navigator.geolocation.getCurrentPosition(locationAcquired); | |
function locationAcquired (whatever) { | |
new_book = { "title":$("#title-field").val(), |
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
Something |
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
Using rake (0.8.7) | |
Using abstract (1.0.0) | |
Using activesupport (3.0.5) | |
Using builder (2.1.2) | |
Using i18n (0.4.1) | |
Using activemodel (3.0.5) | |
Using erubis (2.6.6) | |
Using rack (1.2.1) | |
Using rack-mount (0.6.14) | |
Using rack-test (0.5.7) |
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 'couchrest_model' | |
module RcmEngine | |
class Organization < CouchRest::Model::Base | |
use_database CouchRest.database('http://<LOGIN>:<PASSWORD>@<ACCOUNT>.cloudant.com/rcm_engine_remix_rcm/') | |
property :description, String | |
property :name, String | |
property :remix_organization, Integer |
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 'activesupport' | |
def days_in_month(year, month) | |
(Date.new(year, 12, 31) << (12-month)).day | |
end | |
f = File.new("items.csv", "r") |
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 Decoder / Encoder | |
# | |
# Originally from http://refactormycode.com/codes/513-morse-code-encoder-decoder | |
# With modifications. | |
# Uploaded & shared for the purpose of a class at UMLV. | |
module Morse | |
$LETTER = Hash[*%w/ | |
A .- N -. |