Skip to content

Instantly share code, notes, and snippets.

Avatar
🦈

Ricardo Canelas ricardocanelas

🦈
View GitHub Profile
@ricardocanelas
ricardocanelas / js-array.js
Last active Jan 1, 2017
Javascript / Array
View js-array.js
const inventors = [
{ first: 'Albert', last: 'Einstein', year: 1879, passed: 1955 },
{ first: 'Isaac', last: 'Newton', year: 1643, passed: 1727 },
{ first: 'Galileo', last: 'Galilei', year: 1564, passed: 1642 },
{ first: 'Marie', last: 'Curie', year: 1867, passed: 1934 },
{ first: 'Johannes', last: 'Kepler', year: 1571, passed: 1630 },
{ first: 'Nicolaus', last: 'Copernicus', year: 1473, passed: 1543 },
{ first: 'Max', last: 'Planck', year: 1858, passed: 1947 },
{ first: 'Katherine', last: 'Blodgett', year: 1898, passed: 1979 },
{ first: 'Ada', last: 'Lovelace', year: 1815, passed: 1852 },
@ricardocanelas
ricardocanelas / js-console.js
Created Jan 1, 2017
Javascript / Console Tool
View js-console.js
console.log('Hello');
console.log('Hello I am %s', 'Ricardo');
console.log('%c I am a great sentence', 'font-size:14px; background-color:red');
console.warn('OH NOOO');
console.error('OH shit!');
@ricardocanelas
ricardocanelas / js-copying-arrays-objects.js
Created Jan 2, 2017
Javascript / Copying Arrays and Objects
View js-copying-arrays-objects.js
// Array
const players = ['Ricardo', 'Canelas', 'Robyn', 'Emma'];
const team = players.slice();
const team2 = [].concat(players);
const team3 = [...players]; // ...spread
// Object - *note: this is only 1 level deep
const person = {name: 'Ricardo Canelas', age: 23};
const capitan = Object.assign({}, person, { from: 'Brazil' });
@ricardocanelas
ricardocanelas / VagrantFile
Last active Sep 17, 2020
Vagrant / PHP7.1 + MySQL5.6 + Apache
View VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.100.100"
config.vm.synced_folder "./www", "/var/www/", :nfs => { :mount_options => ["dmode=777","fmode=666"] }
@ricardocanelas
ricardocanelas / polish.md
Created Feb 18, 2017
Polish for Brazilian People
View polish.md

Good morning Dzien dobry / Jindobre /

Good night Dobranoc / DoBRAnos /

Hi

@ricardocanelas
ricardocanelas / webpack-3.md
Last active Oct 30, 2017
[NOTE] Webpack 3.0
View webpack-3.md

WEBPACK

SOLUTIONS

import .min files

LOADERS

View _React Notes.md
@ricardocanelas
ricardocanelas / Kernel.php
Created Sep 3, 2018
Laravel / Locale (middleware)
View Kernel.php
<?php // app/Http/kernel.php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
//...
protected $middlewareGroups = [
View react-mock.md

package.json

"devDependencies": {
    "enzyme": "^3.3.0",
    "enzyme-adapter-react-16": "^1.1.1",
    "jest-fetch-mock": "^1.4.2",
    "sinon": "^4.4.2",
    "source-map-explorer": "^1.5.0"