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 _process(value) { | |
return new Promise(function (fulfill, reject) { | |
var count = 0, timeout; | |
timeout = setInterval(function () { | |
console.log('iteration ' + count); | |
if (count > 5 && value !== 'fail') { fulfill(true); clearInterval(timeout); } | |
else if (count > 5 && value === 'fail') { reject('Operation timed out.'); clearInterval(timeout); } | |
count += 1; | |
}, 100); | |
}); |
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
var page = require('webpage').create(); | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; | |
page.open("https://www.facebook.com", function(status) { | |
if ( status === "success" ) { | |
page.evaluate(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
*.log | |
*.sql | |
.DS_Store | |
.htaccess | |
*.map | |
error_log | |
Movefile | |
wp-cli.yml | |
sitemap.xml | |
sitemap.xml.gz |
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
var casper = require("casper").create({ | |
//loadImages: false, | |
//logLevel: 'debug', | |
verbose: true | |
}); | |
var utils = require('utils'); | |
/* ----- test parameters ----- */ |
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
var casper = require('casper').create({ | |
verbose: true, | |
logLevel: "info", | |
pageSettings: { | |
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11" | |
} | |
}); | |
casper.start("https://httpbin.org/user-agent", function() { | |
this.test.assertTextExists( |
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
#credits https://stackoverflow.com/questions/26193654/node-js-catch-enomem-error-thrown-after-spawn | |
sudo fallocate -l 4G /swapfile #Create a 4 gigabyte swapfile | |
sudo chmod 600 /swapfile #Secure the swapfile by restricting access to root | |
sudo mkswap /swapfile #Mark the file as a swap space | |
sudo swapon /swapfile #Enable the swap | |
echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab #Persist swapfile over reboots (thanks for the tip, bman!) |
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
var casper = require('casper').create({ | |
verbose : true, | |
logLevel : 'info' | |
}); | |
var images = []; | |
var fs=require("fs") | |
/** | |
* Configuration here | |
*/ |
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
PATH_TO_MAGENTO='/path/to/magento/installation/folder' | |
GITHUB_TOKEN='github-token-here' | |
MAGENTO_USER='your-key-here' | |
MAGENTO_PASS='your-pass-here' | |
MAGENTO_ADMIN_URL='http://your-server.com' | |
MAGENTO_ADMIN_USER='admin' | |
MAGENTO_ADMIN_PASS='admin123' | |
# ondrej best php apt-repository for php to be able to | |
# update and install PHP as needed |
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
##################################################### | |
# | |
# Provided by the Magento Support Center | |
# http://magentosupport.help/knowledgebase/configuring-nginx-to-work-with-magento-advanced/ | |
# | |
# Your Magento Tutorial specialists | |
# | |
server { | |
listen *:8080; | |
server_name fanatik.redrokk.com www.fanatikbike.com fanatikbike.com; |
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
/** | |
* Append data to a Google Spreadsheet | |
* | |
* You will need a file called '.env' with the following values: | |
* | |
* - GOOGLE_ID (Google oAuth Client ID) | |
* - GOOGLE_SECRET (Google oAuth Client Secret) | |
* - GOOGLE_REFRESH_TOKEN (Google oAuth Refresh Token) | |
* - GOOGLE_SPREADSHEET_ID (Google Spreadsheet ID) | |
* |
OlderNewer