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
try{ | |
// ... | |
} | |
catch( Exception $e ) | |
{ | |
if ($e instanceof UserNotFoundException) { | |
// it's an instance of UserNotFoundException, return accordingly | |
} | |
elseif ($e instanceof SomethinElseException) { | |
// it's an instance of SomethinElseException, return accordingly |
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 | |
trait Name { | |
function say($word) | |
{ | |
return $word; | |
} | |
} |
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
import React, { PropTypes } from 'react' | |
import ReactDOM from 'react-dom' | |
import { createStore } from 'redux' | |
import { Provider, connect } from 'react-redux' | |
import _ from 'lodash' | |
// Main component. | |
class Main extends React.Component { | |
render() { | |
return ( |
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 | |
use Illuminate\Foundation\Testing\DatabaseMigrations; | |
class ProductControllerTest extends TestCase | |
{ | |
use DatabaseMigrations; | |
protected $testSubject = null; |
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 | |
use Aws\CloudSearch\CloudSearchClient; | |
use Aws\CloudSearchDomain\CloudSearchDomainClient; | |
// http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-cloudsearchdomain.html | |
$client = CloudSearchDomainClient::factory(array( | |
//'endpoint' => 'https://doc-example-xxx.ap-southeast-1.cloudsearch.amazonaws.com', | |
'endpoint' => 'https://search-example-xxx.ap-southeast-1.cloudsearch.amazonaws.com', |
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
{ | |
"directory": "./resources/assets/vendor" | |
} |
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
$data = []; | |
$data[0] = ['S', 'M', 'L']; | |
$data[1] = ['RED', 'BLACK']; | |
$data[2] = ['IRON', 'COTTON']; | |
$data[3] = ['STRONG', 'WEAK']; | |
$data[4] = ['MAJOR', 'MINOR']; | |
$data[5] = ['XX', 'YY']; | |
class Possible | |
{ |