View casper-google-places-autocomplete.js
function setPlacesAutocomplete(selector, value) { | |
casper.then(function () { | |
casper.sendKeys(selector, value, { keepFocus: true }); | |
casper.page.sendEvent('keydown', 0); | |
casper.page.sendEvent('keyup', 0); | |
}); | |
casper.waitUntilVisible('.pac-container .pac-item', function () { | |
casper.page.sendEvent('keydown', casper.page.event.key.Down); | |
casper.page.sendEvent('keydown', casper.page.event.key.Enter); | |
}); |
View benchmark.php
<?php | |
use Everyman\Neo4j\Client, | |
Everyman\Neo4j\Transport\Stream, | |
Everyman\Neo4j\Transport\Curl, | |
Everyman\Neo4j\Cypher\Query; | |
require_once 'example_bootstrap.php'; | |
$transport = new Stream(); | |
// $transport = new Curl(); |
View session_serialize.php
<?php | |
function session_serialize(array $data) { | |
$temp = $_SESSION; | |
$_SESSION = $data; | |
$out = session_encode(); | |
$_SESSION = $temp; | |
return $out; | |
} | |
function session_unserialize($data) { |
View manifests-site.pp
class base_node { | |
loggly::device { "application_log": } | |
loggly::device { "apache_access": } | |
loggly::device { "apache_error": } | |
} |
View loggly_api.js
$.ajax("https://mydomain.loggly.com/api/facets/date/?q=my_search_criteria", { | |
// Don't send the _=timestamp query parameter | |
cache: true, | |
// Send HTTP auth credentials | |
username: api_readonly_username, | |
password: api_readonly_password, | |
// Use JSONP | |
dataType: "jsonp" | |
}).done(function(data) { | |
// handle data, probably a call to some graphing library |
View 0-initial.php
<?php | |
// index.php | |
$app->get('/{id}', function ($id) use ($app) { | |
$controller = new Lal\HelloController(); | |
return $controller->helloId($id); | |
}); | |
$app->get('/', function () use ($app) { | |
$controller = new Lal\HelloController(); | |
return $controller->index(); | |
}); |
View cypher_delete.php
<?php | |
error_reporting(-1); | |
ini_set('display_errors', 1); | |
spl_autoload_register(function ($sClass) { | |
$sLibPath = __DIR__.'/../lib/'; | |
$sClassFile = str_replace('\\',DIRECTORY_SEPARATOR,$sClass).'.php'; | |
$sClassPath = $sLibPath.$sClassFile; | |
if (file_exists($sClassPath)) { | |
require($sClassPath); | |
} |
View sudoredirect.sh
sudo sh -c 'ls -hal /root/ > /root/test.out' |
View mutual.php
<?php | |
$client = new Everyman\Neo4j\Client(); | |
$queryString = | |
"START firstPerson=node({firstId}), secondPerson=node({secondId}) " . | |
"MATCH firstPerson -[:FRIEND]-> mutualFriend <-[:FRIEND]- secondPerson" . | |
"RETURN mutualFriend"; | |
$params = array( | |
"firstId" => 123, |
View invoker.php
<?php | |
interface Command | |
{ | |
public static function register(); | |
public function execute(); | |
} | |
class HelloCommand implements Command { | |
protected $name; |
NewerOlder