Skip to content

Instantly share code, notes, and snippets.

View stomita's full-sized avatar

Shinichi Tomita stomita

View GitHub Profile
@stomita
stomita / gist:8121020
Created December 25, 2013 07:35
Add event handler to upload files.
var bucketName = 'salesforce-bucket';
var bucket;
$(function() {
initAWSCredentials();
initEventHandlers();
updateFileList();
});
function initAWSCredentials() {
@stomita
stomita / S3FileList.html
Last active January 1, 2016 08:49
Add file select input.
...
<body>
<input type="hidden" id="samlResponse" value="{!$CurrentPage.parameters.SAMLResponse}" />
<div>
Select File to Upload: <input type="file" id="fileSelect" />
</div>
<ul id="fileList"></ul>
</body>
...
@stomita
stomita / S3FileList.page
Last active January 28, 2023 05:13
List S3 files in a bucket, using AWS JavaScript SDK with SAML assertion
<apex:page showHeader="false"
standardStylesheets="false"
sidebar="false"
contentType="text/html"
applyBodyTag="false"
applyHtmlTag="false"
cache="true"
docType="html-5.0">
<html>
<head>
@stomita
stomita / cors-config.xml
Created December 24, 2013 07:43
S3 CORS configuration sample
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
@stomita
stomita / S3FileList.page
Last active January 1, 2016 07:09
A Visualforce Page to dump SAML response
<apex:page showHeader="false"
standardStylesheets="false"
sidebar="false"
contentType="text/html"
applyBodyTag="false"
applyHtmlTag="false"
cache="true"
docType="html-5.0">
<html>
<head>

Untitled Slide

Welcome to Glide.

Glide is the easiest way to create useful slide for all of your Gists.

  • input key <- to go backward.
  • input key -> to go forward.

Publishing

@stomita
stomita / edi-rama-take-back-your-city-with-paint.md
Created February 18, 2013 00:58
Gisted: Edi Rama: Take back your city with paint | Video on TED.com
<apex:page>
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js" />
<apex:outputPanel>
<div class="ng-app">
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here" />
<hr />
<h1>Hello {{yourName}}!</h1>
</div>
</apex:outputPanel>
$(function() {
//
function someFuncInternallyUsed() {
// ...
}
$('#btnA').click(someFuncInternallyUsed);
$('#formA').submit(someFuncInternallyUsed);
});
(function() {
//
function someFuncInternallyUsed() {
// ...
}
$('#btnA').click(someFuncInternallyUsed);
$('#formA').submit(someFuncInternallyUsed);
})();