Skip to content

Instantly share code, notes, and snippets.

View kunal732's full-sized avatar

Kunal Batra kunal732

  • DataDog
  • United States
View GitHub Profile
#################################
# #
# IP List Segmentation #
# with SendGrid Event Webhook #
# #
# Created by Kunal Batra 8.08.14#
#################################
from flask import Flask,request, jsonify
import requests
@kunal732
kunal732 / geo.py
Created July 21, 2014 21:22
Kreso code for geo
#################################
# #
# Geographic List Segmentation #
# with SendGrid Event Webhook #
# #
# Created by Kunal Batra 7.14.14#
#################################
from flask import Flask,request, jsonify
import requests
@kunal732
kunal732 / emailalert.py
Created February 27, 2014 18:49
SendGrid + Twilio
from flask import Flask, request
import json
from twilio.rest import TwilioRestClient
app = Flask(__name__)
@app.route('/',methods=['POST'])
def foo():
account_sid = "Your Twilio Account SID"
auth_token = "Your Twilio Auth Token"
@kunal732
kunal732 / addroute
Created January 28, 2014 13:50
Adding Route to Meteor
Meteor.Router.add({
'/inbound': function() {
post = this.request.body;
color = post.subject;
Colors.update({pos: 1},{ $set: { "name": color } } );
return [200, "Success"]
}
});
package main
import (
"fmt"
"net/http"
"log"
"github.com/sendgrid/sendgrid-go"
"regexp"
)
@kunal732
kunal732 / Objective-C Library
Last active December 27, 2015 03:59
send email with sendgrid-obj library
//create Email Object
sendgrid *msg = [sendgrid user:@"ApiUser" andPass:@"ApiKey"];
//set parameters
msg.subject = @"email subject";
msg.tolist = @[@"[email protected]", @"[email protected]"];
msg.from = @"[email protected]";
msg.text = @"hello world";
msg.html = @"<html><body><h1>hello world</h1></body></html>";
@kunal732
kunal732 / gist:6339045
Created August 26, 2013 08:03
Calling Parse Cloud Module
NSDictionary *params = [NSDictionary dictionaryWithObject:List forKey:@"text"];
[PFCloud callFunctionInBackground:@"emailGrocery" withParameters:params block:^(id object, NSError *error){} ];
var sendgrid = require("sendgrid");
sendgrid.initialize("SendGrid_Auth_User", "SendGrid_Auth_token");
// Use Parse.Cloud.define to define as many cloud functions as you want.
// For example:
Parse.Cloud.define("hello", function(request, response) {
response.success("Hello world!");
});
Parse.Cloud.define("emailGrocery", function(request, response) {
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
@interface ViewController : PFQueryTableViewController {
NSString *List;
NSDictionary *params;
NSInteger counter;
NSInteger refresh;
}
- (IBAction)sendList:(id)sender;
@kunal732
kunal732 / ViewController.m
Last active December 21, 2015 17:09
Parse PFQueryTableViewController for IOS Storyboard
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (id)initWithCoder:(NSCoder *)aDecoder {