This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# eve-text-mud | |
## Player States: | |
Space | |
Docked | |
# Command List | |
### Space Commands | |
- .dock <object> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$myPOST = $request->getParsedBody(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$myGET = $request->getQueryParams(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Let's use it! | |
$app->get('/hello[/[{name}]]', function ($req, $res, $args) { | |
if (!empty($args['name'])) { | |
return $this->view->render($res, "hello.twig", ["name" => $args['name']]); | |
} else { | |
return $this->view->render($res, "hello.twig", ["name" => ""]); | |
} | |
}); | |
$app->run(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$app->get('/hello[/[{name}]]', function ($req, $res, $args) { | |
$get = $req->getQueryParams(); // Grab the Query Params... ["test" => "true"] | |
if (!empty($args['name'])) { | |
return $this->view->render($res, "hello.twig", ["name" => $args['name'], "test" => $get['test']]); | |
} else { | |
return $this->view->render($res, "hello.twig", ["name" => "", "test" => $get['test']]); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Let's configure it. | |
// Fetch DI Container | |
$container = $app->getContainer(); | |
// Register Twig View helper and configure it | |
$container['view'] = function ($c) { | |
//You can change this as you want | |
$view = new \Slim\Views\Twig('templates', [ | |
'cache' => false //or specify a cache directory | |
]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$app->get('/hello[/[{name}]]', function ($req, $res, $args) { | |
if (!empty($args['name'])) { | |
return $res->write("Why Hello " . $args['name']); | |
} else { | |
return $res->write("Hello!"); | |
} | |
}); |