Skip to content

Instantly share code, notes, and snippets.

View bobmagicii's full-sized avatar
🤌

Bob Magic II bobmagicii

🤌
View GitHub Profile
<?php
class ImageEditor {
static public function
MakeImageSquare(Imagick $Image, int $Square):
Imagick {
// $Image->CropThumbnailImage($Square,$Square);
// this method has a terrible habit of breaking every 3rd release.
@bobmagicii
bobmagicii / not-an-actual-mod.psc
Last active December 17, 2015 23:02
papyrus the language of skyrim has nullable types.
Function DoSomeShit(Actor Who)
{do some shit with the specified actor. }
If(Who == None)
Who = Game.GetPlayer()
EndIf
;; ...
Return
@bobmagicii
bobmagicii / plzwait.php
Last active December 16, 2015 22:15
enter
<?php
/*
C:\Users\bob\Desktop>php plzwait.php
1450303435.52
1450303436.0004
*/
function WaitForPerigee() {
// wait until the last possible moment so that we have as much of the
<?php
public function
OnConstruct() {
$this->Get->Page(function(int $p):int {
if($p < 1) return 1;
else return $p;
});
return;
@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;