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
/*global sforce:true */ | |
(function() { | |
function loadScript(url, callback) { | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = url; | |
if (callback) { | |
script.onload = callback; | |
script.onreadystatechange = function() { |
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
<apex:page showHeader="false" | |
standardStylesheets="false" | |
sidebar="false" | |
contentType="text/html" | |
applyBodyTag="false" | |
applyHtmlTag="false" | |
cache="true" | |
docType="html-5.0"> | |
<html> | |
<head> |
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
/** | |
* Connect and fetch Salesforce data via OAuth | |
*/ | |
function queryDataFromSalesforce() { | |
// Read OAuth consumer key / secret of this client app from script properties, | |
// which can be issued from Salesforce's remote access setting in advance. | |
var sfConsumerKey = ScriptProperties.getProperty("sfConsumerKey"); | |
var sfConsumerSecret = ScriptProperties.getProperty("sfConsumerSecret"); | |
if (!sfConsumerKey || !sfConsumerSecret) { | |
Browser.msgBox("Register Salesforce OAuth Consumer Key and Secret in Script Properties"); |
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
<?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> |
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
Show hidden characters
{ | |
"presets": [ | |
["@babel/env", { | |
"targets": { "esmodules": true } | |
}] | |
] | |
} |
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
import fs from 'fs'; | |
import os from 'os'; | |
import path from 'path'; | |
import sqlite3 from 'sqlite3'; | |
import jsforce, { Connection } from 'jsforce'; | |
const SCANSNAP_DB_DIR = path.join(os.homedir(), '/Library/Application Support/PFU/ScanSnap Home/Managed/'); | |
const SCANSNAP_FILE_DIR = path.join(os.homedir(), '/Documents/ScanSnapHome.localized'); | |
const SCANSNAP_DB_FILE = path.join(SCANSNAP_DB_DIR, 'ScanSnapHome.sqlite'); | |
const TIMESTAMP_FILE = '.timestamp'; |
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
import { createStateHook } from 'react'; | |
export function createFormInputHook() { | |
const useValueState = createStateHook(); | |
return (initialValue) => { | |
const [value, setValue] = useValueState(initialValue); | |
function onHandleChange(e) { | |
setValue(e.target.value); | |
} | |
return { value, onChange: onHandleChange }; |
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
/* @flow */ | |
import EventEmitter from 'events'; | |
import React, { type Node, type ComponentType } from 'react'; | |
import PropTypes from 'prop-types'; | |
/** | |
* Mimics new context API using legacy context | |
*/ | |
type LegacyContextProvider<T> = ComponentType<{ value: T, children: Node }>; |
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
/** | |
* | |
*/ | |
import React, { createContext } from 'react'; | |
import { createStore } from 'redux'; | |
import { connect, Provider } from 'react-redux'; | |
import { render } from 'react-dom'; | |
import { compose, lifecycle, withStateHandlers, shouldUpdate } from 'recompose'; | |
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
/* @flow */ | |
type NMap = { [key:string]: number } | |
// これは当然だめ | |
const map1: NMap = { | |
a: 1, | |
b: 2, | |
c: 'a', | |
}; |
NewerOlder