Skip to content

Instantly share code, notes, and snippets.

View lpj145's full-sized avatar
😁
Good Feeling!

Marcos Dantas lpj145

😁
Good Feeling!
  • Parelhas - RN, Brazil
View GitHub Profile
@lpj145
lpj145 / icms.js
Last active July 31, 2023 12:30
Estrutura de ICMS
export const ORIGEM = [
'0 – Nacional, exceto as indicadas nos códigos 3, 4, 5 e 8;',
'1 – Estrangeira – Importação direta, exceto a indicada no código 6;',
'2 – Estrangeira – Adquirida no mercado interno, exceto a indicada no código 7;',
'3 – Nacional, mercadoria ou bem com Conteúdo de Im…) e igual ou inferior a 70% (setenta por cento) ;',
'4 – Nacional, cuja produção tenha sido feita em co….248/1991, 8.387/1991, 10.176/2001 e 11.484/2007;',
'5 – Nacional, mercadoria ou bem com Conteúdo de Importação inferior ou igual a 40%;',
'6 – Estrangeira – Importação direta, sem similar n…stante em lista de Resolução Camex e gás natural;',
'7 – Estrangeira – Adquirida no mercado interno, se…stante em lista de Resolução Camex e gás natural.',
'8 – Nacional – Mercadoria ou bem com Conteúdo de Importação superior a 70% (setenta por cento).'
function specialAdd(a: Number, b: Number, factor: Number) {
return (a + b) * factor
}
export function math2() {
return add(a: Number, b: Number) {
return specialAdd(2, 3, 10)
}
}
const questions = [
'WHats your name ?',
'The book is on the table ?',
'The car is moving ?',
'Is the best or worst driver you see ?'
]
let currentQuestion = 0
const showQuestion = () => {
<script>
import { debounce } from '@/utils/function'
import httpClient from '@/utils/httpClient'
export default {
name: 'VAutocompleteServer',
props: {
value: {
type: [Array, Object, Number, String],
default: () => ([])
@lpj145
lpj145 / FormTest.vue
Created May 14, 2021 13:54
Strong expansable form.
<script>
export default {
name: 'FormTest',
provide: {
// Try to imagine what you can do with this approach
// So much to think :)
register(input) {
this.inputs.push(input)
}
},
@lpj145
lpj145 / FormTest.vue
Created May 14, 2021 13:45
Simple form without v-models.
<script>
export default {
name: 'FormTest',
methods: {
saveForm({ target }) {
const data = new FormData(target)
data.forEach((value, key) => {
console.log(`Field: ${key}, value: ${value}`)
})
// axios.post('/bla', data) You can use direct on axios
<script>
export default {
name: 'CardContainer',
}
</script>
<template>
<div class="container is-fluid is-flex is-flex-direction-column">
<ul id="matchesList" class="is-flex is-flex-direction-column is-align-item">
<slot name="favoritos" />
@lpj145
lpj145 / DesafioEmTudo.rs
Created March 20, 2021 23:29
Processar 9 milhoes de linhas csv com rust.
use std::{collections::HashMap, fs::File, io::{self, BufRead, BufReader}};
use std::time::{SystemTime, UNIX_EPOCH};
use core::time::Duration;
pub fn get_unix_timestamp_ms() -> Duration {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("Time went problem.")
}
@lpj145
lpj145 / amodal.vue
Created March 16, 2021 23:38
Modal with vue3
<script lang="ts">
import './AModal.scss'
import { defineComponent, onUpdated, ref } from 'vue'
export interface AModalProps {
width?: number | string
show?: boolean
persistent?: boolean
}
@lpj145
lpj145 / cheat.js
Last active March 4, 2021 16:46
Cheat for pokemon pwa game
// See href: https://pokemon-match.netlify.app/#/
// Open browser console, copy past it, have fun :)
(function (document){
const btn = document.createElement('button')
btn.className = 'v-btn v-size--default'
btn.innerText = 'Perfect Match!'
btn.style.position = 'fixed'
btn.style.bottom = '120px'
btn.style.left = '50px'
btn.style.border = '2px solid #898989'