Skip to content

Instantly share code, notes, and snippets.

@coderdiaz
coderdiaz / BiAxialLineChart.tsx
Created May 24, 2024 02:07
An example of BiAxialLineChart using Tremor Raw LineChart
// An example of BiAxialLineChart
// using the Tremor Raw LineChart [v0.0.0]
//
// New props
// yRightCategory -> Category to show according to the yAxisRight
// yAxisRightLabel -> Label to be showed in yAxisRight
//
// Concerns:
// It's limited to only one category associated to yAxisRight if you want to support
// multiples categories only change it to array instead of single string.
import { Strapi } from '@strapi/strapi';
export default (strapi: Strapi) => ({ nexus }) => ({
types: [
nexus.extendType({
type: 'Query',
definition(t) {
t.field('courseById', {
type: 'CourseEntity',
args: {
@coderdiaz
coderdiaz / settings.json
Created March 27, 2022 02:54
My VS Code config
{
// Editor
"editor.fontFamily": "'MonoLisa', Menlo, Monaco, 'Courier New', monospace",
"editor.lineHeight": 38,
"editor.tabSize": 2,
"editor.cursorStyle": "block",
"editor.renderWhitespace": "all",
"editor.minimap.enabled": false,
"editor.minimap.size": "fit",
"editor.minimap.renderCharacters": false,
# Insomnia Configuration
## Run the test query
{
shop {
id
name
}
}
# Query Structure Examples
function launchAll(missiles, launchMissile) {
for(var i = 0; i < 5; i++) {
setTimeout(function() {
launchMissile(i);
}, i * 1000);
}
}
// [1, 2, 3, 4, 5]
// Escribir una función llamada inOrder la cuál va ha aceptar dos callbacks y los invocaremos en orden.
const logOne = setTimeout(function() {
console.log("one!");
}, Math.random() * 1000);
const logTwo = setTimeout(function() {
console.log("two!");
}, Math.random() * 1000);
@coderdiaz
coderdiaz / app.js
Created October 8, 2020 13:07 — forked from joshnuss/app.js
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
FROM node:12.16.1 As development
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --only=development
COPY . .
RUN npm run build
.
└── example-api-nest
├── README.md
├── nodemon.json
├── ormconfig.js
├── package.json
├── source
│   ├── entities
│   │   ├── Credential.ts
│   │   ├── Currency.ts
@coderdiaz
coderdiaz / scoreboard.css
Created February 1, 2020 15:49
Scoreboard Styles
@import url(https://fonts.googleapis.com/css?family=Quicksand:400,700);*{outline:0 none;padding:0;margin:0}body{font-family:Quicksand,sans-serif;background:#e9e9e9}.grid{display:grid;grid-gap:15px}@-webkit-keyframes beat{0%{-webkit-transform:scale(1.5);transform:scale(1.5)}20%{-webkit-transform:scale(1.4);transform:scale(1.4)}40%{-webkit-transform:scale(1.3);transform:scale(1.3)}60%{-webkit-transform:scale(1.2);transform:scale(1.2)}80%{-webkit-transform:scale(1.1);transform:scale(1.1)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes beat{0%{-webkit-transform:scale(1.5);transform:scale(1.5)}20%{-webkit-transform:scale(1.4);transform:scale(1.4)}40%{-webkit-transform:scale(1.3);transform:scale(1.3)}60%{-webkit-transform:scale(1.2);transform:scale(1.2)}80%{-webkit-transform:scale(1.1);transform:scale(1.1)}to{-webkit-transform:scale(1);transform:scale(1)}}.scoreboard{width:600px;min-height:250px;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.sc