This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
let data = String(count: 100*1024*1024, repeatedValue: Character("A")).dataUsingEncoding(NSUTF8StringEncoding)! | |
let chunkSize = 5 * 1024 * 1024 // 5MB | |
var offset = 0 | |
var sessionId = "" | |
func uploadFirstChunk() { | |
let size = min(chunkSize, data.length) | |
self.client.files.uploadSessionStart(body: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, redirect, url_for, session, request, render_template | |
from dropbox.client import DropboxClient, DropboxOAuth2Flow | |
import dropbox | |
import redis | |
from datetime import datetime, timedelta | |
import os | |
# Token for the account holding the images | |
my_token = os.environ['TOKEN'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
certificate generated via: | |
openssl req -x509 -nodes -days 365 -subj "/CN=test" -newkey rsa:1024 -keyout priv.pem -out pub.pem | |
openssl x509 -outform der -in pub.pem -out pub.cer | |
(pub.cer is what's uploaded to Windows Azure via the portal) | |
### | |
crypto = require 'crypto' | |
https = require 'https' | |
fs = require 'fs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* certificate generated via: | |
openssl req -x509 -nodes -days 365 -subj '/CN=test' -newkey rsa:1024 -keyout priv.pem -out pub.pem | |
openssl x509 -outform der -in pub.pem -out pub.cer | |
(pub.cer is what's uploaded to Windows Azure via the portal) | |
*/ | |
var crypto = require('crypto'), | |
https = require('https'), | |
fs = require('fs'); |