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
for line in (cat .env) do | |
export $line | |
done |
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
-I | |
../include | |
-I | |
../vendor/include | |
-std=c++14 | |
-stdlib=libc++ | |
-fPIC | |
-isystem | |
/usr/local/include |
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
export const abbreviationNumber = number => { | |
const qtdMulti = number / 1000; | |
if (qtdMulti >= 1 && qtdMulti < Math.pow(10, 3)) { | |
return number / Math.pow(10, 3) + 'K'; | |
} | |
if (qtdMulti >= Math.pow(10, 3) && qtdMulti < Math.pow(10, 6)) { | |
return number / Math.pow(10, 6) + 'M'; | |
} | |
if (qtdMulti >= Math.pow(10, 6) && qtdMulti < Math.pow(10, 9)) { |
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
export function getDiffTimeBetweenCurrentDate (dateString = '', now = new Date()) { | |
const dayInMilliseconds = 86400000 | |
if ([null, undefined, false, true].includes(dateString)) { | |
return dateString | |
} | |
const date = new Date(dateString) | |
const isInvalidDate = isNaN(date.getTime()) | |
if (isInvalidDate) { | |
return dateString |
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 create () { | |
const events = {} | |
function off (n, callback) { | |
if (!events[n]) { | |
return | |
} | |
events[n] = events[n].filter(fn => fn !== callback) | |
} |
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
export const kebabToCamel = obj => Object.keys(obj).reduce((acc, cur) => { | |
return { | |
...acc, | |
[camelize(cur)]: buildValue(obj[cur]) | |
} | |
}, {}) | |
function camelize (property) { | |
const s = property.split('_') | |
const capital = s.map((item, index) => { |
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
syntax on | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
set ai | |
set number | |
set hlsearch | |
set ruler | |
highlight Comment ctermfg=green |
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
const METHODS = ['get', 'post']; | |
export const createHTTPClient = baseURL => METHODS.reduce((acc, cur) => ({ | |
...acc, | |
[cur]: async (path, options) => { | |
const res = await window.fetch(`${baseURL}${path}`, { method: cur.toLowerCase(), ...options }); | |
const json = await res.json(); | |
return json; | |
}, | |
}), {}); |
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
#!/usr/bin/env bash | |
# gitignore generator | |
function gi() { | |
curl -L -s https://www.gitignore.io/api/$@ ; | |
} |
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
(() => { | |
let count = 0; | |
function getAllButtons() { | |
return document.querySelectorAll('.full-width.artdeco-button.artdeco-button--2.artdeco-button--full.artdeco-button--secondary.ember-view') || []; | |
} | |
async function connect() { | |
const buttons = getAllButtons(); |