This file contains hidden or 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
/** | |
* Converts a hex color code to an RGB color object. | |
* @param {string} hex - The hex color code to convert. | |
* @returns {object} An object with the red, green, and blue components of the RGB color. | |
*/ | |
function hexToRGB(hex) { | |
// Remove the # character from the beginning of the hex code | |
hex = hex.replace("#", ""); | |
// Convert the red, green, and blue components from hex to decimal |
This file contains hidden or 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
// NOTE: this was a test to determine if useToast function type could be annotated using JSDoc. | |
// The catch is that thi function returns a different type depending if a parameter is present or not | |
// For some reason, it is not recognizing @param {undefined}, so that the type can not be inffered correctly | |
// Typescript solution: | |
// https://www.typescriptlang.org/play?#code/C4TwDgpgBMD2CGBnYB5ARgKwgY2FAvFAN4BQUUy8wArogPwBcFwATgJYB2A5gNxlRtssDo2btufcsDbAANhCbJxvfgBMIibOzDThi1pxXl4uNsPpMAgixbwQAHngcQAPj4BfPiVCQYCZABiHARQABRwSMBMEcjoWLgAlAQuUABusGyqXj7QMcAAwsKssLKIIaRS-sCIAKIAHmBO6qqiaLAlEE6SUGAssAC2Ovny8CyWsrKWpqkQre0jHN3YI2MToqFJ+Cnpmd2IEMAACn2DBSvjsuub2xlZ-HnDggDWV8lpt91wXFzy9Y0czVeW3eu34ABI8tEqkEPNlwNBaBAACpVFA6MwcMqECpQIQcYqlOYdLokdwkEgAeip1JptLpdPJVKgqlgGg4AHI8P0qMAICwoAAzWD84AACzYZQgdXgg3kJHkeDytQaTQgqhCAvgpQg8oOPROQ3OEym0hmIVY1B1eOQuKNshCGzeRDJ1rw+yOBrOnVW9sIjuBzpIrr8kUe2CeDuuxBd5kVsG+vxVALVkadZKDsagEKqUMiQQdkJDsUwOGAUZxTJZbM5UG5wF5-KFIvFkulsp15GtHQAdLJ46EAER5OKlgcAGiLZdJjPps7nFJnUAAqocACKWJE1VfkgXUDim |
This file contains hidden or 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
{ | |
"title": "Map Option+Backward-delete to Ctrl+Backward-Delete.", | |
"rules": [ | |
{ | |
"description": "Map Option+Backward-delete to Ctrl+Backward-Delete. (delete current word).", | |
"type": "basic", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "delete_or_backspace", |
This file contains hidden or 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
; Replaces Win + Left = home | |
#left:: | |
send {home} | |
return | |
; Replaces Win + Right = end | |
#right:: | |
send {end} | |
return |
This file contains hidden or 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
/** | |
* Flatten multidimensional Arrays | |
* @param {Array} arrayToFlat multidimensional array to be flatten. | |
* @returns {Array} array flattened | |
*/ | |
function flatten(arrayToFlat = []) { | |
const result = [] | |
arrayToFlat.forEach(element => { | |
if (Array.isArray(element)) { |
This file contains hidden or 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
/* eslint-disable no-unreachable */ | |
/* eslint-disable require-atomic-updates */ | |
// import _ from "lodash"; // LODASH is imported and used globally, configured in webpack | |
import axios from "axios" | |
import store from "store" // store is the Vuex store instance | |
import router from "router" // router is the Vue Router instance | |
import { warn, warnDialogParse } from "utils/alerts" // helpers to show alerts and error messages | |
// create an axios instance |
This file contains hidden or 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
// 'request' it's an axios instance, that it has a request interceptor setted on it (to add an auth header) | |
// This is all done in utils/request.js. So that all api calls made with 'request' had auth header setted on it | |
import request from "utils/request" | |
export function getResponsabilities(userId) { | |
return new Promise(async (resolve, reject) => { | |
try { | |
const res = await request({ | |
url: `v1/f12/${userId}/responsabilities`, | |
method: "get", |
This file contains hidden or 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 axios from "axios" | |
export function getSellers() { | |
return axios({ | |
url: "v1/sellers/", | |
method: "get", | |
}) | |
} | |
export function createInvoice(data) { |
This file contains hidden or 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
{"lastUpload":"2019-10-25T14:45:28.109Z","extensionVersion":"v3.4.3"} |
This file contains hidden or 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
const averange = (input) => { | |
const {sum, count} = sumAndCount(input) | |
return sum/count | |
} | |
const sumAndCount = (arr) => { | |
let count = 0 | |
const sum = arr.reduce((acc, element) => { |
NewerOlder