Skip to content

Instantly share code, notes, and snippets.

@oceanapplications
oceanapplications / SerpTest.php
Created May 18, 2018 02:49
Search engine ranking position tracker build on Laravel Dusk
<?php
namespace Tests\Browser;
use function foo\func;
use Tests\DuskTestCase;
use Laravel\Dusk\Browser;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class SerpTest extends DuskTestCase
it("should read ethereum price through oraclize", function(){
return Contract.deployed().then(function(instance){
return instance;
}).then(function(instance){
instance.updatePrice({value:20000});
});
});
it("should wait 1 minute and read returned value", function(){
setTimeout(function(){
0x8fE7eE0A9127e1B3cf1A0a43851217C87F0BD417
@oceanapplications
oceanapplications / gist:44d69d83971d3248b60a
Created June 29, 2015 04:02
String case inversion script
//Version 1, simple and performs about 40 times better than version 2
$input = "i FORGOT CAPLOCK";
$output = "";
foreach(str_split($input) as $letter)
{
if(ctype_upper($letter))
{ $output .= strtolower($letter);}
else { $output .= strtoupper($letter); }
}
echo $output;