Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View heitortsergent's full-sized avatar

Heitor Tashiro Sergent heitortsergent

View GitHub Profile
@heitortsergent
heitortsergent / webhook_azk.sh
Last active August 29, 2015 14:16
Steps to test webhook with azk
# 1. git clone the repository
$ git clone http://github.com/username/yourawesomerepo.git
# 2. add your SendGrid/Twilio/Twitter/Giphy credentials
# 3. run azk start
$ azk start
@heitortsergent
heitortsergent / Azkfile.js
Created February 25, 2015 05:27
Azkfile.js for sendgrid-parse-ngrok demo
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
'sendgrid-parse-api-example': {
// Dependent systems
depends: [],
// More images: http://images.azk.io
@heitortsergent
heitortsergent / app.js1
Last active July 19, 2022 09:23
Email-confirmation Email Tutorial
app.post('/login', function(req,res) {
console.log('user email: ', req.body.email);
res.render('index', {title: 'Sent authentication email'});
});
app.get('/verify_email', function(req,res) {
console.log('verify_email token: ',req.query.token);
res.render('index', {title: 'Authenticating...'});
@heitortsergent
heitortsergent / Import
Created July 31, 2014 00:35
SendGrid Objective-C Library Import
#import <SendGrid/SendGrid.h>
#import <SendGrid/SendGridEmail.h>
@heitortsergent
heitortsergent / sgWeb
Created November 11, 2013 22:38
Sendgrid - Unity Email using Web API
public void SendSendgridEmailWebAPI () {
string url = "https://sendgrid.com/api/mail.send.json?";
url += "to=" + toEmail;
url += "&from=" + fromEmail;
//you have to change every instance of space to %20 or you'll get a 400 error
string subjectWithoutSpace = subject.Replace(" ", "%20");
url += "&subject=" + subjectWithoutSpace;
string bodyWithoutSpace = body.Replace(" ", "%20");
@heitortsergent
heitortsergent / sgSMTP
Last active December 28, 2015 01:39
Sendgrid - Unity Email via SMTP
MailMessage mail = new MailMessage();
mail.From = new MailAddress(fromEmail);
mail.To.Add(toEmail);
mail.Subject = subject;
mail.Body = body;
mail.Headers.Add("X-SMTPAPI", xsmtpapiJSON);
SmtpClient smtpServer = new SmtpClient("smtp.sendgrid.net");
smtpServer.Port = 587;
@heitortsergent
heitortsergent / gist:4715001
Created February 5, 2013 15:07
Check if word exists
for(NSString* word in wordDictionary)
{
if([word hasPrefix:appDelegate2.matchLetter] && [word isEqualToString:wordString])
{
return YES;
}
}
return NO;