Skip to content

Instantly share code, notes, and snippets.

View geggleto's full-sized avatar

Glenn Eggleton geggleto

View GitHub Profile
@geggleto
geggleto / index.php
Created January 26, 2016 22:21
Slim gist 6
<?php
$myPOST = $request->getParsedBody();
@geggleto
geggleto / index.php
Created January 26, 2016 22:29
slim 3 gist 7
<?php
$app->add(function ($req, $res, $next) {
//DO SOMETHING BEFORE THE REQUEST IS PROCESSED
$res = $next($req, $res); //PROCESS THE REQUEST
//DO SOMETHING AFTER THE REQUEST HAS BEEN PROCESSED
if ($res->getStatusCode() > 500) {
//Do something with a server error, maybe email someone or submit a bug report
}
$near = "SELECT c.id, c.name, c.email, c.phone, c.logo, c.banner, c.description, cl.lat, cl.lng,
ACOS( SIN( RADIANS( cl.lat ) ) * SIN( RADIANS( '$lat' ) ) + COS( RADIANS( cl.lat ) )
* COS( RADIANS( '$lat' )) * COS( RADIANS( cl.lng ) - RADIANS( '$lng' )) ) * 6380 AS distance
FROM CLIENT_LOCATION cl
INNER JOIN CLIENT c
on cl.client_id = c.id
WHERE
ACOS( SIN( RADIANS( cl.lat ) ) * SIN( RADIANS( ? ) ) + COS( RADIANS( cl.lat ) )
* COS( RADIANS(? )) * COS( RADIANS( cl.lng ) - RADIANS( ? )) ) * 6380 < 10
ORDER BY distance ASC";
# eve-text-mud
## Player States:
Space
Docked
# Command List
### Space Commands
- .dock <object>
Project Agreement
- Project will start once a 50% payment of ($_____.00) has been paid
- The project will take no less than __ weeks to complete
- Project Code will be kept in a repository owned by the contractor, and the IP rights of the code will be in the sole ownership of the contractor.
- The IP rights will be transferred after the remainder of the payment of ($_____.00) has been received.
- Upon delivery, a 30 day license for the code will be provided. Upon expiration you will be invoiced ($_____.00) each month for a monthly licence.
<?php
namespace App;
use App\Services\ServerProviderFactory;
use Illuminate\Database\Eloquent\Model;
class Provider extends Model
{
public function service()
class UserRequestValidator
{
public function __invoke(Request $request, Response $response $next)
{
$validator = new Validator();
//rules
//Problem: Given an array of integers, find the pair of adjacent elements that has the largest product and return that product.
//[-23, 4, -3, 8, -12]
// -23 * 4 = -92
// 4 * -3 = -12
// -3 * 8 = -24
// 8 * -12 = -96
// Return -12
//Loop N-1 times starting at pos 0
@geggleto
geggleto / gist:7abc7beb8d32d90c78c48dc797069048
Created February 14, 2018 03:52
Family Jewels Distribution Teaser based on the first 88000 kitties
Count 14687
tongue : 4312
laperm : 3325
raisedbrow : 2400
limegreen : 1393
tigerpunk : 1279
Count 17463 / 104000
violet : 1
cerulian : 2
googly : 5
chartreux : 6
spock : 8
whixtensions : 8
skyblue : 13
peach : 13
bloodred : 15