Skip to content

Instantly share code, notes, and snippets.

View Mattieuga's full-sized avatar

Mattieu Gamache-Asselin Mattieuga

View GitHub Profile
@Mattieuga
Mattieuga / parse+sendgrid.js
Last active December 13, 2015 22:18
Sample of using Parse with the SendGrid Cloud Module. This example will send an email when other users comment on a picture in Anypic (https://parse.com/anypic).
// Require the SendGrid Cloud Module
var sendgrid = require("sendgrid");
sendgrid.initialize("you@parse.com", "your_password");
// Run this Cloud Function every time a new Activity (such as a comment)
// is saved
Parse.Cloud.afterSave("Activity", function(request, response) {
// Check if the activity type is a comment
var activity = request.object;
if (activity.get("type") === "comment") {
@Mattieuga
Mattieuga / MyViewController.mm
Last active October 12, 2015 09:28
Code snippet for Twilio/Parse sample app
// Call our Cloud Function that sends an SMS with Twilio
[PFCloud callFunctionInBackground:@"inviteWithTwilio"
withParameters:@{ number : phoneNumber }
block:^(id object, NSError *error) {
[[[UIAlertView alloc] initWithTitle:@"Invite Sent!"
message:@"Your SMS invitation has been sent!";
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil, nil] show];
}];