Skip to content

Instantly share code, notes, and snippets.

View larizzatg's full-sized avatar
🎯
Focusing

Larizza Tueros larizzatg

🎯
Focusing
View GitHub Profile
@larizzatg
larizzatg / async_await_and_promises.js
Created April 26, 2018 01:35
Async Await and Promises
// First Function
const canRegister = async (idCard, yunenCard) => {
const url = `${names.API_ENDPOINT_AFFILIATE}BuscarPendienteRegistro`;
const request = {
usuario: null,
requerimiento: `${idCard}-${yunenCard}`,
};
return new Promise((resolve, reject) => {
axios.post(url, request)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
https://strapi.io/blog/building-a-static-website-using-gatsby-and-strapi/#2installation
"remote.WSL.fileWatcher.polling": true
@larizzatg
larizzatg / simple_curry.js
Created April 12, 2020 17:09
Learning how to do a basic curry
const _ = {};
const abc = function(a, b, c) {
return [a, b, c];
}
_.curry = (fn) => {
let arguments = [];
const getArgument = (...args) => {
@larizzatg
larizzatg / simple_composer.js
Created April 12, 2020 17:09
learning how to do a basic compose
const _ = {};
_.compose = (...fns) => {
let result = null;
return (...args) => {
result = args;
for(let i = fns.length - 1; i >= 0; i--) {
let fnResult = fns[i](...result);
result = Array.isArray(fnResult) ? fnResult : [fnResult];
}
@larizzatg
larizzatg / simple_unary.js
Created April 12, 2020 17:15
learning how to do a unary function
const _ = {};
_.map = (arr, fn) => {
const results = [];
for(let i = 0; i < arr.length; i++) {
results.push(fn(arr[i]));
}
return results;
};
@larizzatg
larizzatg / json
Last active March 8, 2021 21:26
storybook v6 new story snippet
{
"new storybook": {
"prefix": "ns",
"body": [
"import ${1:component} from './${2:index}.vue';",
"",
"export default { title: '${3:Components}/${1:component}' };",
"",
"const Template = (args, { argTypes }) => ({",
" components: { ${1:component} },",
@larizzatg
larizzatg / post-fetch-useFetch.vue
Last active July 21, 2021 16:35
Nuxt: Getting data, composition api with useFetch
<template>
<div>
<h1>Post</h1>
<div v-if="post" id="first-post">
<h3 class="text-lg">{{ post.title }}</h3>
<p class="text-base">{{ post.body }}</p>
</div>
</div>
</template>
@larizzatg
larizzatg / post-fetch-normal.vue
Last active July 21, 2021 16:35
Nuxt: Getting data, fetch method
<template>
<div>
<h1>Post</h1>
<div v-if="post" id="first-post">
<h3 class="text-lg">{{ post.title }}</h3>
<p class="text-base">{{ post.body }}</p>
</div>
</div>
</template>
@larizzatg
larizzatg / post-fetch-asyncData.vue
Last active July 21, 2021 16:38
Nuxt: Getting data, asyncData
<template>
<div>
<h1>Post</h1>
<div v-if="post" id="first-post">
<h3 class="text-lg">{{ post.title }}</h3>
<p class="text-base">{{ post.body }}</p>
</div>
</div>
</template>