- JSON-LD:
- Google Structured Data Testing Tool
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
'use strict'; | |
/** | |
* Sorts an array using the insertion algorithm. | |
* | |
* @param {Array} array - The array to be sorted. | |
* @return {Array} | |
*/ | |
function insertionSort(array) { | |
if (array.constructor !== Array) { |
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
'use strict'; | |
/** | |
* Reverses a string or array. | |
* | |
* @param {(String|Array)} i - The string or array. | |
* @return {(String|Array)} | |
*/ | |
function reverse(i) { | |
var isString = false; |
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
'use strict'; | |
/** | |
* Fullscreen (CTRL + F) | |
*/ | |
slate.bind('f:ctrl', function(window) { | |
window.doOperation(move({ | |
x: 'screenOriginX', | |
y: 'screenOriginY', | |
width: 'screenSizeX', |
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 webdriver = require('selenium-webdriver'); | |
// since no browser is specified in the builder | |
// you can set the target browser at runtime | |
// through the SELENIUM_BROWSER environment variable | |
// e.g., SELENIUM_BROWSER=phantomjs node driver_test.js | |
var driver = new webdriver.Builder().build(); | |
driver.get('https://www.google.com'); | |
driver.getTitle().then(function(title) { | |
console.log(title); | |
}); |
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
'use strict'; | |
/** | |
* Module dependencies. | |
*/ | |
var webdriver = require('selenium-webdriver'); | |
var chrome = require('selenium-webdriver/chrome'); | |
/** | |
* Chrome options. |
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 webdriver = require('selenium-webdriver'); | |
var By = webdriver.By; | |
var driver = new webdriver.Builder().forBrowser('safari').build(); | |
driver | |
.get('https://www.wikipedia.org') | |
.then(function() { | |
return driver.sleep(1000); | |
}) | |
.then(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
'use strict'; | |
/** | |
* Convert arguments from array-like object to array. | |
* | |
* @param {...*} | |
* @return {Array} | |
*/ | |
function argumentsToArray() { | |
return Array.prototype.slice.call(arguments, 0); |
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
'use strict'; | |
/** | |
* Curry the function. | |
* | |
* @param {Function} func - The function to curry. | |
* @param {...*} | |
* @return {Function} | |
*/ | |
function curry(func) { |
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
'use strict'; | |
/** | |
* Create a bound function. | |
* | |
* @param {Function} func - The function to be bound. | |
* @param {Array} args - The function arguments. | |
* @param {*} [context] - The function context. | |
*/ | |
function bind(func, args, context) { |
OlderNewer