Skip to content

Instantly share code, notes, and snippets.

Running: Demo test Google
INFO Request: POST /wd/hub/session
- data: {"desiredCapabilities":{"browserName":"phantomjs","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY"},"sessionId":null}
- headers: {"Content-Type":"application/json","Content-Length":132}
INFO Response 200 POST /wd/hub/session{ status: 0,
sessionId: 'a1bd37ef-253c-4f4e-9fc6-545a212110ee',
value:
{ platform: 'MAC',
acceptSslCerts: false,
javascriptEnabled: true,
@xrado
xrado / gist:6389156
Last active December 22, 2015 00:28
mootools namespaced events
[Element, Window, Document].invoke('implement', {
// Call as element.addNsEvent('event.namespace', function() {});
addNsEvent: function(name, fn) {
// Get event type and namespace
var split = name.split('.'),
eventName = split[0],
namespace = split[1];
// Store the event by its full name including namespace
this.bindCache = this.bindCache || {};
@xrado
xrado / gist:1014273
Created June 8, 2011 11:45
elasticsearch date sort
#mapping
curl -X DELETE http://localhost:9200/test/?pretty=true -d ''
curl -X PUT http://localhost:9200/test/?pretty=true -d ''
curl -X PUT http://localhost:9200/test/test/_mapping?pretty=true -d '
{
"test":{
"properties":{
"cid":{
"type":"string",
<?php if (!defined('APPLICATION')) exit();
// Define the plugin:
$PluginInfo['RssFeed'] = array(
'Description' => 'This simple plugin for new discussions and discussions updates',
'Version' => '1.0',
'RequiredApplications' => FALSE,
'RequiredTheme' => FALSE,
'RequiredPlugins' => FALSE,
'HasLocale' => TRUE,
<?php defined('SYSPATH') or die('No direct script access.');
class Date extends Kohana_Date {
public static function format($date,$format='U',$offset=NULL)
{
if (empty($date) || $date == '0000-00-00 00:00:00' || $date == '0000-00-00') return NULL;
try
{
<?php defined('SYSPATH') or die('No direct script access.');
/**
* MsSQL database connection.
*
* @package Kohana/Database
* @category Drivers
* @author Kohana Team, xrado
* @copyright (c) 2008-2009 Kohana Team
* @license http://kohanaphp.com/license
*/
<?php
class Kohana_Database_MsSQL extends Database_PDO {
public function query($type, $sql, $as_object)
{
// Make sure the database is connected
$this->_connection or $this->connect();
if ( ! empty($this->_config['profiling']))
{
@xrado
xrado / x.js
Created October 28, 2009 09:26
CmdUtils.CreateCommand({
name: "moo",
description: "test moo",
preview: function(pblock, statusText) {
CmdUtils.injectJavascript("http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js";,
Utils.safeWrapper(function() {
pblock.innerHTML = MooTools;
})
);
},
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Paypal Payment Driver. Express Checkout transactions consist of 3 stages with
* a separate API call for each: SetExpressCheckout, GetExpressCheckout (optional)
* and DoExpressCheckout. This class has a corresponding array of fields for each
* call these are used to construct the required name value pairs for the request
* to each API call.
*
* $Id: Paypal.php 1978 2008-03-25 12:05:32GMT by atomless -
*