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
(function() { | |
// | |
function someFuncInternallyUsed() { | |
// ... | |
} | |
$('#btnA').click(someFuncInternallyUsed); | |
$('#formA').submit(someFuncInternallyUsed); | |
})(); |
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/bash | |
COMPILE_JOBS=1 | |
PREFIX="/app/vendor/phantomjs" | |
QT_CFG="-I$PREFIX/include -L$PREFIX/lib" | |
until [ -z "$1" ]; do | |
case $1 in | |
"--qt-config") |
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/bash | |
BUILDPACK_PREFIX=/app/vendor/phantomjs | |
PHANTOMJS_VERSION="1.9.1" | |
PHANTOMJS_DIR="phantomjs-${PHANTOMJS_VERSION}" | |
FONTCONFIG_VERSION="2.10.2" | |
FONTCONFIG_DIR="fontconfig-${FONTCONFIG_VERSION}" | |
mkdir -p ${BUILDPACK_PREFIX} | |
curl -L "http://fontconfig.org/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz" | tar zxf - |
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 $@" |
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
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 /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
#!/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
/*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
/** | |
* 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"); |