@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {
// This one is interesting because no previously checked condition is re-checked | |
// It is a self-executing function that contains a declarative function named fizzbuzz() and a for loop | |
// Too much fun | |
(function() { | |
function fizzbuzz(i) { | |
const test = (d, s, x) => i % d == 0 ? _ => s + x('') : x | |
const fizz = x => test(3, 'Fizz', x) | |
const buzz = x => test(5, 'Buzz', x) | |
console.log(fizz(buzz(x=>x))(i.toString())) | |
} |
<?php | |
/* | |
* This file is part of the League\Fractal package. | |
* | |
* (c) Phil Sturgeon <me@philsturgeon.uk> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace App\Serializer; |
<?php | |
/* | |
//Normal query | |
User::all(); | |
//Cached query (default 60min) | |
User::cached()->all(); | |
//Cached query (5min) |
@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {
#Laravel 5 Simple ACL manager
Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.
If the user has a 'Root' role, then they can perform any actions.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php
###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.
#!/usr/bin/env ruby | |
old_sha1, new_sha1, ref = gets.split | |
if ref == "refs/heads/master": | |
puts "Pushing to origin/master is not permitted." | |
puts "This is a read-only branch." | |
puts "" | |
puts "Create a new branch instead, or commit to SVN." |