var page = new WebPage(), testindex = 0, loadInProgress = false; | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; | |
page.onLoadStarted = function() { | |
loadInProgress = true; | |
console.log("load started"); | |
}; |
// XPath CheatSheet | |
// To test XPath in your Chrome Debugger: $x('/html/body') | |
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
// 0. XPath Examples. | |
// More: http://xpath.alephzarro.com/content/cheatsheet.html | |
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
<?php | |
$navigation = Loader::helper('navigation'); | |
$c = Page::getCurrentPage(); | |
// get the attribute key by handle | |
$ak = CollectionAttributeKey::getByHandle('your_attribute_handle'); | |
// get the attribute type controller | |
$atc = $ak->getController(); | |
// check if the attibure type is select | |
if ($atc instanceOf SelectAttributeTypeController) { |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
-
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the
secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection. -
Use production SSL certificates locally. This is annoying
<?php | |
/* | |
* Author: David T. Sadler (http://davidtsadler.com) | |
* Date: 2013-03-29 | |
* License: I release this example into the public domain. Use at your own risk. | |
* | |
* Example showing how to list an item to the eBay Sandbox using the eBay Accelerator Toolkit New Schema (EbatNS) for PHP. | |
* | |
* This example uses version 815 released on the 2013-03-22. | |
* http://www.intradesys.de/en/system/files/its_downloads/EbatNs_1_0_815_P5_0.zip |
console.log("got here"); | |
var page = require('webpage').create(); | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; | |
page.open("http://facebook.com", function(status) { | |
if ( status === "success" ) { |