Skip to content

Instantly share code, notes, and snippets.

🎯
Working on a shady CMS called Machi

João Ferreira lubien

🎯
Working on a shady CMS called Machi
Block or report user

Report or block lubien

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View WithForm.js
function defaultDirtyForForm(form) {
return Object.keys(form).reduce((acc, key) => {
acc[key] = false;
return acc;
}, {});
}
const WithForm = defaultForm => {
const fields = Object.keys(defaultForm());
View TagForm.vue
<template>
<div class="card">
<div class="card-body">
<h4 class="card-title">
{{ isEditing ? "Editando tag" : "Criando Tag" }}
</h4>
<form @submit.prevent="onSubmit" class="forms-sample">
<b-form-group v-if="entity" :disabled="true" label="ID">
<b-form-input :value="entity.id"></b-form-input>
View fgo.json
[
{
"id":1,
"name":"Mashu Kyrielight",
"starGeneration":9.9,
"npGain":0.84,
"hits":{
"quick":2,
"arts":2,
"buster":1,
View foo.md

a

a

Disallow Warning Comments (no-warning-comments)

b

View allowedExtensions.js
function allowedExtensions (exts) {
return exts.map((item, i) => {
const first = i === 0
const last = i === (exts.length - 1)
if (first) {
return [item]
}
if (last) {
View foo.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
1
2
3
4
5
6
7
8
9
@lubien
lubien / promise.js
Created Jun 19, 2019
O que é uma promise?
View promise.js
// Promise mais simples que você pode ter.
// Ainda que o retorno *pareça* imediado, lembre-se que
// ainda estamos em contexto de computação assíncrona.
// Note que não usamos uma função nossa pra gerar a promise,
// mas usamos uma função do próprio JS.
const p1 = Promise.resolve(1)
// Função cujo retorno é uma promise.
You can’t perform that action at this time.