Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://www.kissmetrics.com/" />
<title>kiss metric 2</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
@sr3d
sr3d / marrily_api.md
Last active September 23, 2015 17:28

Marrily's data can be accessed via a RESTful interface. Here are the documentation on how to access the API. Currently the data are represented via JSON format only.

  1. v1 API info =============== The current API is at v1, and the all API access is over HTTP, starting with

    http://api.marrily.com/api/v1/

If the subscription is expired, you will get a 402 error for non-GET requests (except for user's authentication).

Ti.include('../../lib/active_record.js');
Ti.include('../../lib/utils.js');
Ti.include('../../lib/models.js');
win.orientationModes = [ Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT ];
/* intermediate page to let quick refresh */
var tableView = Ti.UI.createTableView({style: Titanium.UI.iPhone.TableViewStyle.GROUPED});
/* Wrapper on top of the HTTP client */
function Request(url, options) {
if( !url ) { throw "Invalid URL"; };
options = _.extend({
method: 'GET',
async: true,
evalJSON: true,
parameters: {},
headers: [], // [ [key, value], [key, value] ]
onSuccess: function(){},
Ti.include('../../lib/active_record.js');
Ti.include('../../lib/utils.js');
Ti.include('../../lib/models.js');
win.title = 'Guests';
var
eventId = DB.get('event_id'),
guests = [],
Ti.include('../../lib/active_record.js');
Ti.include('../../lib/utils.js');
Ti.include('../../lib/models.js');
var guest = Model.Guest.find(win.guest.id),
gift = Model.Gift.find({ first: true, where: {guest_id: guest.id} }),
sections = [],
currentSection = 0,
yesNoBtn, amountInput, giftDescription,
tableView = Ti.UI.createTableView({ style: Titanium.UI.iPhone.TableViewStyle.GROUPED });
source ~/.bashrc
alias ll="ls -ll"
alias la="ls -la"
alias psgrep="ps aux | grep"
alias ss="script/server"
alias rr="rake routes > routes"
alias rs="rails server --debugger"
alias r="rails"
export EDITOR="mate"
ActiveRecord.executeScalar = function() {
// arguments.splice(0,1);
var rows = ActiveRecord.execute.apply(this, arguments);
var value = rows.isValidRow() ? rows.field(0) : null;
rows.close();
return value;
};
# for roo gem to parse XML
gem 'ruby-ole-patched-for-home_run'
gem 'rubyzip' # required for roo
gem 'spreadsheet' # require for roo
gem 'nokogiri'
gem 'roo', :git => 'http://github.com/sr3d/roo.git', :branch => 'nokogiri'
# gem 'roo' # for Excel parsing
require File.expand_path('../boot', __FILE__)
require 'home_run'
Date::Format::STYLE[:slash] = :mdy # making sure 1.8.7 compatible