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
/** | |
* Tanita BC-601 (Source of Interpretation: https://github.com/cab938/tanita) | |
* | |
* Usage example: import-BC601.js ~/inputFile.csv ~/outputFile.json | |
*/ | |
const fs = require("fs"); | |
const [inputFile, outputFile] = process.argv.slice(2); | |
const dictionary = { |
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 knex = require("knex"); | |
class DbCreator { | |
/** | |
* | |
* Usage example: | |
* const DbCreator = require('./DbCreator) | |
* const dbConfigs = { | |
* host: "127.0.0.1", | |
* user: "postgres", |
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
<?php | |
/** | |
* Extract query params of the uri. | |
* | |
* @param $uri - The uri. | |
* E.g.: http://localhost:8080/users?limit=10&offset=10 | |
* | |
* @return array - Returns an array with query params and values. | |
* E.g.: [ | |
* 'limit' => '10', |
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 moveArrayIndex = (arr, fromIndex, toIndex) => { | |
const elementFrom = arr[fromIndex]; | |
arr.splice(fromIndex, 1); | |
arr.splice(toIndex, 0, elementFrom); | |
return [...arr]; | |
}; |
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
/** | |
* This function allows you to compare two versions in x.x.x format. | |
* | |
* Conditions: | |
* v1 == v2 = 0 | |
* v1 > v2 = 1 | |
* v1 < v2 = -1 | |
* | |
* @example | |
* compareVersions('0.0.0', '0.0.1'); |
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
function buildQueryParams(params = {}) { | |
const arrParams = Object.keys(params); | |
if(!arrParams.length) { | |
return ''; | |
} | |
return `?${arrParams.map(param => `${param}=${params[param]}`).join('&')}`; | |
} | |
console.log(buildQueryParams()); // '' | |
console.log(buildQueryParams({})); // '' |
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
/** | |
* @example | |
* | |
* const path = '/user/:user_id/test/:test_id'; | |
* | |
* const params = { | |
* user_id: 50000, | |
* test_id: 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
<div class="swiper-container" style="height: 100%"> | |
<div class="swiper-wrapper" style="height: 100%"> | |
<div id="slide-1" class="swiper-slide" style="height: 100%"> | |
<div class="w-slide1"> | |
<div class="slide-container"> | |
<button id="close-wellcome" class="btn-voltar uppercase">Saltar</button> | |
<img src='img/wellcome/screen-01.png'> | |
<div class="wellcome-title"> | |
<div style="font-size: 14px">Bem vindo à App</div> | |
<div class="uppercase" style="font-size: 18px">Seaside Lovers</div> |
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
/** | |
* Evitar IF's Javascript | |
*/ | |
getQualquerCoisa(dominioId, permissao){ | |
let querys = { | |
'getAllDomains': { | |
'query': `SELECT * FROM qq`, | |
'params': [] | |
}, |
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
<?php | |
class Date { | |
protected $CI; | |
private $db_default_timezone; | |
public function __construct() | |
{ | |
$this->CI =& get_instance(); | |
$this->_getDefaultTimestamp(); | |
} |
NewerOlder