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
javascript:(function(d){__sfdcSessionId=d.cookie.match(/(^|;\s*)sid=(.+?);/)[2];d.body.appendChild(d.createElement('script')).src='/soap/ajax/18.0/connection.js';setTimeout("sforce.debug.open()",2000)})(document) |
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
javascript:(function(d){d.body.appendChild(d.createElement('script')).src='/soap/ajax/18.0/connection.js';setTimeout(function(c,u,ui){c=sforce.connection;c.sessionId=d.cookie.match(/(^|;\s*)sid=(.+?);/)[2];u=new sforce.SObject('User');ui=c.getUserInfo();u.Id=ui.userId;u.LanguageLocaleKey=/ja/.test(ui.userLanguage)?'en_US':'ja';c.update([u]);location.reload()},1000)})(document) |
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
trigger AccountAddressTrigger on Account (before insert, before update) { | |
Pattern p = Pattern.compile('^\\s*〒?\\s*(\\d{3}\\-\\d{4})?\\s*(東京都|北海道|(?:京都|大阪)府|.{2,3}県)?\\s*(.[^市区町村]*[市区群町村])(.*\\s*.*)$'); | |
for (Account acc : Trigger.new) { | |
if (Trigger.isUpdate) { | |
Account oldAcc = Trigger.oldMap.get(acc.Id); | |
if (oldAcc.Address__c == acc.Address__c) continue; | |
} | |
if (acc.Address__c == null) continue; | |
Matcher m = p.matcher(acc.Address__c); | |
if (m.find()) { |
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
/*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
#!/bin/sh | |
# | |
# This installation script is for creating environment of heroku buildpack of PhantomJS | |
# Assuming the script to be run on fakesu command by using fakesu buildpack. | |
# See. https://github.com/fabiokung/heroku-buildpack-fakesu | |
# | |
export PATH=/sbin:/usr/sbin:$PATH | |
cd /app/ |
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
#!/bin/sh | |
cd /app | |
SCRIPT=$1 | |
PORT=$2 | |
export DISPLAY=:1 | |
Xvfb :1 -screen 0 1024x768x24 -nolisten tcp -shmem & | |
phantomjs $SCRIPT $PORT |
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
curl https://raw.github.com/gist/1977632/install.sh -o ./install.sh | |
chmod 755 ./install.sh | |
fakesu -c $PWD/install.sh |
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
#!/bin/sh | |
cd $1 | |
shift | |
export DISPLAY=:1 | |
phantomjs $@ |
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
#!/bin/sh | |
if ! [ -e $HOME/.root/tmp/.X1-lock ]; then | |
echo "X server not started. Starting..." | |
fakesu -c "Xvfb :1 -screen 0 1024x768x24 -nolisten tcp -shmem" & | |
fi | |
fakesu -c "phantomexec.sh $PWD $@" |
OlderNewer