Skip to content

Instantly share code, notes, and snippets.

View ricardocanelas's full-sized avatar
🦈

Ricardo Canelas ricardocanelas

🦈
View GitHub Profile
@ricardocanelas
ricardocanelas / js-array.js
Last active January 1, 2017 13:23
Javascript / Array
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 January 1, 2017 17:29
Javascript / Console Tool
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 January 2, 2017 12:03
Javascript / Copying Arrays and Objects
// 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 September 17, 2020 05:45
Vagrant / PHP7.1 + MySQL5.6 + Apache
# -*- 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 February 18, 2017 18:51
Polish for Brazilian People

Good morning Dzien dobry / Jindobre /

Good night Dobranoc / DoBRAnos /

Hi

@ricardocanelas
ricardocanelas / webpack-3.md
Last active October 30, 2017 20:27
[NOTE] Webpack 3.0

WEBPACK

SOLUTIONS

import .min files

LOADERS

@ricardocanelas
ricardocanelas / Kernel.php
Created September 3, 2018 14:07
Laravel / Locale (middleware)
<?php // app/Http/kernel.php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
//...
protected $middlewareGroups = [
@ricardocanelas
ricardocanelas / react-mock.md
Last active October 4, 2018 17:30
React - Mock

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"
@ricardocanelas
ricardocanelas / _wordpress-helpers.md
Last active December 22, 2018 14:57
WordPress Helpers
  • getPrevNext();
  • register_post_type