Skip to content

Instantly share code, notes, and snippets.

View johnwmcarneiro's full-sized avatar
🐏
Programando...

John Carneiro johnwmcarneiro

🐏
Programando...
View GitHub Profile
@johnwmcarneiro
johnwmcarneiro / app.php
Created March 16, 2024 21:15
MVC, Repository example
<?php
use PDO;
# App\Pessoa.php
class Pessoa
{
public $id;
public $name;
public $gender;
@johnwmcarneiro
johnwmcarneiro / router_index.js
Created October 15, 2019 20:51
Vue + Axios + JWT + Middleware
// router/index.js
const routes = [];
const router = new Router({
mode: 'hash', // https://router.vuejs.org/api/#mode
linkActiveClass: 'open active',
scrollBehavior: () => ({ y: 0 }),
routes
});
@johnwmcarneiro
johnwmcarneiro / api.js
Last active May 1, 2019 14:53
Example abstract fetch
/**
* Created by @johnwmcarneiro 30/04/2019
*
* Requires:
* - querystring
*/
'use strict';
const { stringify } = require('querystring');