Skip to content

Instantly share code, notes, and snippets.

View sferoze's full-sized avatar

Feroze Shahpurwala sferoze

View GitHub Profile
##### Rewards API #####
# CALL THIS METHOD TO SEARCH AND RECEIVE GET A LIST OF PRODUCTS ON AMAZON
amazonItemSearch: (keyword, category, page) ->
# Page value can be a number 1-10.
# Category has to be one of the categories available on the parent web
# Keyword is the search keyword
return [Object, Object, Object] # Will receive an array with objects as return value
@sferoze
sferoze / stridepostUserSchema.js
Last active September 23, 2015 22:48
stridepostUserSchema
// SHARED SCHEMA FOR BOTH ADULT AND CHILD. PROFILE CONTAINS KEYS FOR BOTH ADULT AND CHILD
// SOME KEYS ARE ONLY RELAVANT TO ADULT AND SOME ONLY TO CHILD
// BUT SINCE THEY ARE ALL USERS WE HAVE TO SHARE THE SAME SCHEMA
// SO MANY KEYS IN PROFILE ARE MARKED AS OPTIONAL.
Schema.UserProfile = new SimpleSchema(
firstName:
type: String
regEx: /^[a-zA-Z-]{2,25}$/
optional: true
lastName:
@sferoze
sferoze / schemas.coffee
Last active November 17, 2015 19:19
Schemas For Stridepost
###### FAMILIES SCHEMA ########
###### EACH FAMILY HAS ONE DOCUMENT ######
Schemas.Family = new SimpleSchema(
name:
type: String
adults:
type: [Object]
'adults.$.userId':
type: String
children:
func callTestMethod() {
Meteor.callMethodWithName("testMethod", parameters: "hello test method") { result in
println(result)
// You should receive back a string saying "I have received the following value hello test method"
}
func setupSubscription() {
let subscriptionLoader = SubscriptionLoader()
var childUserInfoSubscription = subscriptionLoader.addSubscriptionWithName("childUserInfo")
var testSubscription = subscriptionLoader.addSubscriptionWithName("testPub")
@sferoze
sferoze / ViewController.swift
Created July 22, 2015 13:49
Example View Controller showing DDP package integration.
import UIKit
import Foundation
class ViewController: UIViewController, SubscriptionLoaderDelegate {
let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
@sferoze
sferoze / AppDelegate.swift
Created July 22, 2015 13:46
Showing the AppDelegate integrating Meteor DDP package
import UIKit
import CoreData
import Meteor
let Meteor = METCoreDataDDPClient(serverURL: NSURL(string: "wss://stridepost.meteor.com/websocket"))
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
@sferoze
sferoze / gist:3e03d16103d039fa3a6b
Created June 5, 2015 03:59
Meteor Router example
Router.configure
layoutTemplate: 'layout',
progressDelay : 100
loadingTemplate: 'loading'
waitOn: ->
if Meteor.user()?
[
#Meteor.subscribe 'notifications'
Meteor.subscribe 'myFamilies'
]
@sferoze
sferoze / lircd.conf
Last active August 29, 2015 14:12 — forked from pda/lircd.conf
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.9.0-pre1(default) on Sat Dec 7 19:14:59 2013
#
# contributed by
#
# brand: lirc-pda.conf
# model no. of remote control: