Skip to content

Instantly share code, notes, and snippets.

@dangerouse
dangerouse / generic-csv.html
Created August 6, 2015 16:59
CloudSponge Widget Reference - Include Generic CSV Upload Form
<!DOCTYPE html>
<html>
<head>
<script>
// Replace YOUR_WIDGET_SCRIPT with your widget script
// get it here: http://www.cloudsponge.com/account/success/install
(function(u){
var d=document,s='script',a=d.createElement(s),m=d.getElementsByTagName(s)[0];
a.async=1;a.src=u;m.parentNode.insertBefore(a,m);
})('//api.cloudsponge.com/widget/YOUR_WIDGET_SCRIPT.js');
@dangerouse
dangerouse / lazy.html
Last active September 29, 2015 10:08
Lazy loaded widget that waits for the user's click to add the Cloudsponge resources to the page.
<!DOCTYPE html>
<html>
<body>
<!--
This sample page adds a link to launch the cloudsponge widget only if the user clicks.
This will reduce the load time of your page and is especially useful if the primary
purpose of the page is not importing address books.
The page only depends on the Cloudsponge Widget script.
-->
@dangerouse
dangerouse / gist:1586071
Last active September 29, 2015 10:17
Cloudsponge Proxy Reference - Python & Django
# Cloudsponge proxy reference
# Python reference implementation using django
#
# contributed by Dannie Chu of foodoro.com
from django.http import HttpResponse, HttpResponseRedirect
# from fdr.logging.logger import Logger
from urllib2 import HTTPRedirectHandler
import urllib
import urllib2
@dangerouse
dangerouse / padded_sidebar.html
Created January 10, 2012 04:23
Fixed sidebar with header boundary using jQuery
<!DOCTYPE html>
<html>
<body>
Content that stays put...
<div id="sidebar" style="height:3000px">
<div id="scroller-anchor"></div>
<div id="scrolling-content">
The content that scrolls!
</div>
</div>
@dangerouse
dangerouse / create.html
Created January 12, 2012 18:55
Very simple jQuery Ajax form
<div>A new bit of data added.</div>
@dangerouse
dangerouse / Default.aspx
Created January 16, 2012 22:15
Cloudsponge Proxy Reference - .Net
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CloudSpongeProxy._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<asp:Label ID="lblContent" runat="server"></asp:Label>
@dangerouse
dangerouse / proxy.conf
Created January 16, 2012 22:42
Cloudsponge Proxy Reference - Nginx
location /proxy/ {
proxy_pass https://api.cloudsponge.com/auth;
}
@dangerouse
dangerouse / httpd.conf
Created January 16, 2012 22:44
Cloudsponge Proxy Reference - Apache
ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar
@dangerouse
dangerouse / stylesheet.html
Last active September 29, 2015 16:17
Cloudsponge Widget - Stylesheet Override
<!DOCTYPE html>
<html>
<body>
<a class="cs_import">Add from Address Book</a>
<textarea id="contact_list" style="width:450px;height:82px"></textarea>
<script type='text/javascript'>
// Asynchronously include the widget library.
// TODO: replace with your widget script
(function(u){
var d=document,s='script',a=d.createElement(s),m=d.getElementsByTagName(s)[0];
@dangerouse
dangerouse / child.html
Last active September 29, 2015 21:08
Cloudsponge Widget Reference - Launch widget from a cross domain iframe
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
var parent_domain = "http://parent_domain.com";
function launchCloudspongeInParent() {
window.parent.postMessage("launch", parent_domain);
return false;
}