Skip to content

Instantly share code, notes, and snippets.

Jeffrey Way JeffreyWay

Block or report user

Report or block JeffreyWay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JeffreyWay
JeffreyWay / countries.php
Created Jul 23, 2015
Country Names + Codes
View countries.php
[
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
@JeffreyWay
JeffreyWay / ex.js
Created Jun 23, 2015
Laracasts.com Episode: Algolia + JavaScript + Vue
View ex.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Algolia with JS</title>
<link rel="stylesheet" href="app.css">
</head>
<body>
@JeffreyWay
JeffreyWay / ex.php
Created Apr 13, 2015
Access Laravel from a test that uses the Integrated Selenium extension. https://github.com/laracasts/integrated
View ex.php
use Laracasts\Integrated\Extensions\Selenium;
use Laracasts\Integrated\Services\Laravel\Application as Laravel;
class AuthTest extends Selenium
{
use Laravel;
/**
* @tearDown
View Gulpfile.js
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
gulp.task('browserify', function() {
return browserify('./js/app.js')
.transform(babelify, { stage: 0 })
.bundle()
.on('error', function(e){
View gist:191acba11c041e486427
return gists.map(function(gist) {
return newGist(gist);
});
// Becomes:
return gists.map(gist => newGist(gist))
@JeffreyWay
JeffreyWay / routes.sh
Created Oct 15, 2014
Add this to your ~/.bashrc file (or anywhere related) to give yourself an easy way to view the routes in your Laravel app, or filter the results down to a particular search query.
View routes.sh
function routes()
{
if [ $# -eq 0 ]; then
php artisan route:list
else
php artisan route:list | grep ${1}
fi
}
View ex.php
<?php
/**
* @Middleware("auth")
*/
class Admin {
// ...
}
View ex.php
<?php
$router->get('dogs', ['uses' => 'App\Http\Controllers\DogsController@index', 'domain' => NULL, 'as' => 'dogs_path', 'middleware' => array (
0 => 'auth',
), 'where' => array (
)]);
$router->get('/', ['uses' => 'App\Http\Controllers\HomeController@home', 'domain' => NULL, 'as' => NULL, 'middleware' => array (
), 'where' => array (
)]);
$router->get('about', ['uses' => 'App\Http\Controllers\HomeController@about', 'domain' => NULL, 'as' => NULL, 'middleware' => array (
View ex.php
<?php
/**
* @Get("/")
*/
public function home() {
return 'home page';
}
View handle-example.php
<?php namespace Acme\Jobs;
use Acme\Commanding\CommandHandler;
use Acme\Eventing\EventDispatcher;
class PostJobListingCommandHandler implements CommandHandler {
protected $dispatcher;
protected $repository;
You can’t perform that action at this time.