Skip to content

Instantly share code, notes, and snippets.

View stomita's full-sized avatar

Shinichi Tomita stomita

View GitHub Profile
(function() {
//
function someFuncInternallyUsed() {
// ...
}
$('#btnA').click(someFuncInternallyUsed);
$('#formA').submit(someFuncInternallyUsed);
})();
#!/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")
@stomita
stomita / build.sh
Last active October 5, 2015 00:38
#!/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 -
#!/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 $@"
#!/bin/sh
cd $1
shift
export DISPLAY=:1
phantomjs $@
curl https://raw.github.com/gist/1977632/install.sh -o ./install.sh
chmod 755 ./install.sh
fakesu -c $PWD/install.sh
#!/bin/sh
cd /app
SCRIPT=$1
PORT=$2
export DISPLAY=:1
Xvfb :1 -screen 0 1024x768x24 -nolisten tcp -shmem &
phantomjs $SCRIPT $PORT
#!/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/
/*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() {
@stomita
stomita / SimpleSalesforceConnection.js
Created May 25, 2011 08:40
A Google Apps Script, which simply connects and fetches data from Salesforce RESTful API with OAuth authentication.
/**
* 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");