- Database should support Mysqli
- Namespaces
- Full PSR-0, PSR-4 support by default
This file contains 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
// Package mockmetrics will gather metrics on a mocked function, such as number of calls, record arguments that the | |
// mocked function is called with. | |
// | |
// Example: | |
// | |
// type NumberGetter interface { | |
// GetNumber() int | |
// AddNumber(num int) | |
// } | |
// |
This file contains 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
// Setup signal capture | |
signalShutdown := make(chan os.Signal, 1) | |
signal.Notify(signalShutdown, os.Interrupt, os.Kill, syscall.SIGTERM) | |
ctxCancel, cancel := context.WithCancel(context.Background()) | |
wg := sync.WaitGroup{} | |
// Init API server | |
apiSrv := apiserver.New(ctxCancel, &wg) |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
.container { | |
height: 700px; | |
border: 1px solid #ff0000; | |
} |
This file contains 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 | |
class MyModel | |
{ | |
public $id; | |
public $name; | |
public $date_of_birth; | |
public function getDateOfBirth() | |
{ |
This file contains 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
// DB Interface | |
interface DBInterface { | |
public function query( $myQuery ); | |
} | |
// Database Dependency Class | |
class Database implements DBInterface | |
{ | |
public function query( $myQuery ) { | |
return $myQuery; |
This file contains 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
// Setup the router | |
use Psr\Http\Message\ResponseInterface; | |
use Psr\Http\Message\ServerRequestInterface; | |
// Init container and set PSR7 shareables | |
$routeContainer = new League\Container\Container; | |
// Set response type (must be psr7 response interface) | |
$routeContainer->share('response', Zend\Diactoros\Response::class); |
This file contains 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
select extf.* from ( | |
select ExternalTransactinId | |
from ebay_order_items | |
ExternalTransactionId is not null | |
group by ExternalTransactionID | |
) extf | |
extf.z_shipmentno is null | |
and extf.orderstatus = 'Completed' | |
and extf.timestamp > '2015-02-25' | |
order by extf.timestamp desc; |
This file contains 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
{ | |
"log": { | |
"version": "1.1", | |
"creator": { | |
"name": "Firebug", | |
"version": "2.0" | |
}, | |
"browser": { | |
"name": "Firefox", | |
"version": "32.0.3" |
This file contains 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
$png = [ | |
'format' => 'H32', | |
'marker' => '89504e470d0a1a0a0000000d49484452' | |
]; | |
$bytes_to_read = strlen( $png['marker'] ) / 2; | |
$fp = fopen('your-filename.png', 'r'); | |
$data = fread($fp, $bytes_to_read); | |
fclose($fp); |
NewerOlder