Skip to content

Instantly share code, notes, and snippets.

from flask import Flask, request, jsonify
from random import randint
from sendgrid import Mail, SendGridClient
app = Flask(__name__)
app.debug = True
tweets = []
#put code here
<!doctype html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript" id="jquery"></script>
</head>
<html>
<title>localchat</title>
<body>
<h1>Sorry, we don't have much stuff yet!</h1>
<!---
@elbuo8
elbuo8 / index.js
Created April 7, 2014 16:34
ti.sendgrid blog
var sendgrid = require('tisendgrid')('SENDGRID-USERNAME', 'SENDGRID-PASSOWORD');
sendgrid.send({
to: 'john@email.com',
from: 'doe@email.com',
subject: 'Hello!',
text: 'Hello again!'
}, function (e) {
if (e) {
console.log(e); // Email wasn't sent
}
@elbuo8
elbuo8 / app.yml
Last active August 29, 2015 14:00
Go AppEngine Post
application: your-app-name
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
<html>
<body ng-controller="TestCtrl">
<script src="bower_components/angular/angular.min.js"></script>
<script src="src/sendgrid.js"></script>
<script>
var app = angular.module('app', ['sendgrid']);
app.config(['sendgrid', function(sendgridProvider) {
console.log('here');
}]);
<! DOCTYPE html>
<!--[if it IE 7]> <html class='no-js It-ie9> <![endif]-->
<html class='no-js' lang='en-us'>
<head>
<meta charset='utf-8'>
<meta http-equiv='' content='IE=edge'>
<meta name='description' content='Postcard'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<style>
function calculateDistance(lat1, lon1, lat2, lon2) {
var R = 6371; // km
var dLat = (lat2 - lat1).toRad();
var dLon = (lon2 - lon1).toRad();
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
(function (angular) {
'use strict';
var sendgrid = angular.module('sendgrid', ['cordovaHTTP']);
sendrid.provider('sendgrid', ['cordovaHTTP', function SendGridProvider('cordovaHTTP') {
/*
SMTPAPI Library
*/
#
# This is the default config file. It allows all users to do anything,
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/rlidwka/sinopia/tree/master/conf
#
listen: 0.0.0.0:4873
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<HostName>app.domain.com</HostName>
<ReplaceKeyPrefixWith>#!/</ReplaceKeyPrefixWith>
</Redirect>
</RoutingRule>