This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# v2 syntax | |
version: '2' | |
services: | |
mysql-NOME: | |
image: ambientum/mysql:5.7 | |
container_name: mysql-NOME | |
volumes: | |
- ./.docker/mysql:/var/lib/mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pmt(rate_per_period, number_of_payments, present_value, future_value, type){ | |
future_value = typeof future_value !== 'undefined' ? future_value : 0; | |
type = typeof type !== 'undefined' ? type : 0; | |
if(rate_per_period != 0.0){ | |
// Interest rate exists | |
var q = Math.pow(1 + rate_per_period, number_of_payments); | |
return -(rate_per_period * (future_value + (q * present_value))) / ((-1 + q) * (1 + rate_per_period * (type))); | |
} else if(number_of_payments != 0.0){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computed: { | |
strokeDashoffset() { | |
return 339.292 * (1 - (this.computedPercentage / 100)) | |
}, | |
xAxis() { | |
if (this.computedPercentage >= 100) { return 36 } | |
if (this.computedPercentage >=0 && this.computedPercentage <=9) { return 47 } | |
return 42 | |
}, | |
computedDirection() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Autenticação JWT Vuejs | |
1)Verifica se existe token no localstorage | |
1.1)Existe token = fetch para checar se está valido e salva no vuex | |
1.2)Não existe token = redireciona para tela de login, na qual fará o fetch (item 2) | |
2)Na tela de login envia os dados para a api e recebe a resposta em json | |
2.1)Dados corretos = salva o token no localstorage e no vuex | |
2.2)Dados incorretos = retorna mensagem de erro ao front | |
3)Adiciona ao axios o valor do header padrão do authorization com o token no vuex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function test() | |
{ | |
$cityName = "Viamão"; | |
$stateInitials = "RS"; | |
$states = DB::table('estado') | |
->join('cidade', function ($join) use ($cityName, $stateInitials) { | |
$join->on('cidade.Estado_ID', '=', 'estado.ID') | |
->where('cidade.NomeCidade', '=', $cityName); | |
}) | |
->where('estado.Sigla', '=', $stateInitials) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { get } from 'lodash' | |
/** | |
* @param schema | |
* @param data | |
* @returns {*} | |
*/ | |
export const dotNotation = (schema, data) => { | |
const reduce = (accumulate, key) => { | |
accumulate[schema[key].field] = get(data, schema[key].field, undefined) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// \src\app\modules\auth\services\index.js | |
import store from 'src/app/infra/store' | |
import configureUser from 'src/bootstrap/configure/user' | |
import { promise } from 'src/app/support/utils' | |
/** | |
* @param {string} token | |
* @param {boolean} remember | |
* @param {Function} success | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http from 'src/app/infra/services/http' | |
import store from 'src/app/infra/store' | |
import { register, unRegister, userData } from 'src/app/modules/auth/services' | |
/** | |
* @param {Object} credentials | |
* @param {boolean} remember | |
* @param {Function} success | |
*/ | |
export const login = (credentials, remember, success) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//select display_name | |
//from user_profiles | |
//where id in (select friendships.to_user from friendships where friendships.from_user=1) | |
// | |
//union | |
// | |
//select display_name | |
//from user_profiles | |
//where id in (select friendships.from_user from friendships where friendships.to_user=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
class CategoryController extends ApiController | |
{ | |
//que esse maldito controller vai fazer??? | |
} |
OlderNewer