// jQuery
$(document).ready(function() {
// code
})
<?php | |
namespace Sigep\EloquentEnhancements\Traits; | |
use Illuminate\Database\Eloquent\Relations\BelongsToMany; | |
use Illuminate\Database\Eloquent\Relations\HasMany; | |
use Illuminate\Database\Eloquent\Relations\MorphMany; | |
use Illuminate\Database\Eloquent\Relations\HasManyThrough; | |
use Illuminate\Mail\Message; | |
use Illuminate\Support\MessageBag; |
<?php | |
return [ | |
// http://www.cidades.ibge.gov.br/download/mapa_e_municipios.php?uf=ac (Thu May 14 16:30:15 BRT 2015) | |
'AC' => [ | |
1200013 => 'Acrelândia', | |
1200054 => 'Assis Brasil', | |
1200104 => 'Brasiléia', | |
1200138 => 'Bujari', | |
1200179 => 'Capixaba', |
I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio
function get(obj, path, def) { | |
var fullPath = path | |
.replace(/\[/g, '.') | |
.replace(/]/g, '') | |
.split('.') | |
.filter(Boolean); | |
return fullPath.every(everyFunc) ? obj : def; | |
function everyFunc(step) { |