git init
or
/** | |
* 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"); |
<!doctype html> | |
<html> | |
<head></head> | |
<body> | |
<!-- | |
Obviously this is not production code. Really I was just rendering a map so I could take a screenshot and post it on Twitter, | |
and this was faster than using some Python mapping library (and looks way nicer!). So no judgement, mkay? | |
This plots points taken from my Google Location data, formatted using this handy Python script: |
public class DependentPicklistDemoController { | |
@AuraEnabled | |
public static List<Contact> getContacts() { | |
return [ | |
SELECT Id, Name, AccountId, Account.Name | |
FROM Contact | |
LIMIT 200 | |
]; | |
} |
import akka.actor.ActorSystem | |
import akka.http.Http | |
import akka.stream.FlowMaterializer | |
import akka.http.model._ | |
import akka.stream.scaladsl._ | |
import akka.stream.scaladsl.Source | |
import akka.stream.scaladsl.FlowGraphImplicits._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.Future |
// ----------------------------------------- | |
// CREATE CONTACTS FROM GOOGLE SHEET | |
// ----------------------------------------- | |
// Name of the entry in the Documents entity. | |
String dataFile = 'DemoExport'; | |
// ----------------------------------------- | |
// Get the URL from Documents and retrieve from Google Sheets as TSV. |
var setup = { | |
// Add your keys | |
consumerKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX", | |
consumerSecret: "XXXXXXXXXXXXXX" | |
}; | |
function onOpen(e) { | |
var menu = SpreadsheetApp.getUi().createAddonMenu(); | |
menu.addItem('Login to SF', 'menuAuth'); | |
menu.addItem('Update all reports', 'updateTrigger'); |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
from bs4 import BeautifulSoup | |
import requests | |
import re | |
import urllib2 | |
import os | |
import argparse | |
import sys | |
import json | |
# adapted from http://stackoverflow.com/questions/20716842/python-download-images-from-google-image-search |
/* | |
Copyright 2011 Mavens Consulting, Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |