Skip to content

Instantly share code, notes, and snippets.

View bobmagicii's full-sized avatar
🤌

Bob Magic II bobmagicii

🤌
View GitHub Profile
@bobmagicii
bobmagicii / lol.php
Last active December 16, 2015 17:08
<?php
public function
QueryBlender(array $Input): string {
/*//
use the QueryMerger to output a final string of the merged query.
//*/
return http_build_query($this->QueryMerger($Input));
<?php
class Whatevs {
public function
__ToString() {
/*//
try to generate the string we need, else show a fallback.
//*/
<?php
/*//
this comparing two methods of writing templates. i was indecisive about which
style i should use when using datastore capable objects in templates. to decide
which way i like i decided to let the numbers speak for themselves.
so we have this datastore and to dump it into an html template takes 3 lines of
code regardless of which way i do it.
<div>
<?php if($Shits): ?>
<ul>
<?php foreach($Shits as $Shit): ?>
<li><?php echo $Shit ?></li>
<?php endforeach; ?>
</ul>
<?php else: ?>
<div>Aint No Shit</div>
<?php endif; ?>
<ul class="TextAlignCenter">
<?php $element->Items->Each(function($Value){ ?>
<li><?php echo $Value->Name ?></li>
<?php }); ?>
</ul>
function Whatever() {
return <<< EOF
<div class="All">
<div class="OfThe">
HTML
</div>
</div>
EOF;
<?php
public function
Render() {
if(is_array($this->Value))
foreach($this->Value as &$Value)
$Value = $this->Database->Escape($Value);
// ...
Scriptname Math Hidden
; Calculates the absolute value of the passed in value - N for N, and N for (-N)
float Function abs(float afValue) global native
; Calculates the arccosine of the passed in value, returning degrees
float Function acos(float afValue) global native
; Calculates the arcsine of the passed in value, returning degrees
float Function asin(float afValue) global native
<?php
$router = (new Nether\Router)
->AddRoute('{@}//post/(#)','Routes\Post::ViewByID')
->AddRoute('{@}//admin/post(#)','Routes\Admin\Post::ViewByID');
try { $router->Run(); }
catch(...) { }
catch(...) { }
catch(...) { }
<?php
namespace Nether\Surface\Test;
use \Nether;
use \PHPUnit_Framework_TestCase;
////////
////////
class SurfaceGeneral