Update nginx config to support a longer timeout to prevent it dropping the connection when trying to debug in PHP Storm
fastcgi_read_timeout 600; # Set fairly high for debugging
| { | |
| "query": { | |
| "function_score": { | |
| "query": { | |
| "bool": { | |
| "must": { | |
| "multi_match": {"query": "Renaissance", "fields": ["name", "company"]}, | |
| "term": {"features": "disability_access"}, | |
| }, | |
| "should": { | 
| <?php | |
| register_tick_function(function() { | |
| $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); | |
| $last = reset($bt); | |
| $info = sprintf("%s +%d\n", $last['file'], $last['line']); | |
| file_put_contents('/tmp/segfault.txt', $info, FILE_APPEND); | |
| // or | |
| // file_put_contents('php://output', $info, FILE_APPEND); | |
| }); | 
| <?php | |
| use PhpParser\Node; | |
| use PhpParser\Node\Expr; | |
| error_reporting(E_ALL); | |
| ini_set('memory_limit', -1); | |
| //$dir = __DIR__ . '/../../Symfony_2.3'; | 
| <?php | |
| require __DIR__ . '/vendor/autoload.php'; | |
| $s3 = Aws\S3\S3Client::factory($config); | |
| $s3->registerStreamWrapper(); | |
| $url = 's3://{$bucket}/{$key}'; | |
| // Read CSV with fopen | 
| <?php | |
| // located in the /app/filters.php | |
| /* some original code */ | |
| Route::filter('statistics.auth.basic', function() { | |
| $user = Request::getUser(); | |
| $password = Request::getPassword(); | |
| if (!App::environment('development') && | 
###Jeffrey Way (1) - Bootcamp
Jeffrey went through about 12 subjects one right after the other and gave tips along the way.
1. With Laravel 4.2 it’s easier to use APIs like Mailgun and Mandrill for e-mail notifications. This avoids using SMTP which is really cool.
| <?php | |
| class TransformerAbstract | |
| { | |
| private $fields; | |
| private $allowedFields = array('id', 'name', 'phone', 'email', 'bio', 'num_friends'); | |
| private $partialFields = array( | |
| 'id' => array('id', 'name'), | |
| 'info' => array('name', 'phone', 'email', 'bio'), | |
| 'bio' => array('bio') | 
| <?php | |
| use Faker\Factory as Faker; | |
| abstract class ApiTester extends TestCase { | |
| /** | |
| * @var Faker | |
| */ | |
| protected $fake; | 
| <?php | |
| trait EventGenerator | |
| { | |
| protected $pendingEvents = array(); | |
| protected function raise($event) | |
| { | |
| $this->pendingEvents[] = $event; | |
| } |