Skip to content

Instantly share code, notes, and snippets.

View vasco3's full-sized avatar

Gorka Cesium vasco3

View GitHub Profile
@vasco3
vasco3 / 10001st PrimeNum
Created September 19, 2013 06:42
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10 001st prime number?
/*
By listing the first six prime numbers:
2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
*/
function findPrimeNumber(n){
//declare a counter and a variable of the latest prime number
@vasco3
vasco3 / gist:f499f7c5a453b04e1be75bb6b6964f76
Created October 6, 2025 23:47
convex_tanstack_guidelines.md
# Convex + TanStack Start Integration Guidelines
Esta sección describe cómo integrar Convex eficientemente con TanStack Start, cubriendo los patrones más comunes para queries, mutations y actions.
## Setup inicial
Antes de usar estos patrones, asegúrate de tener configurado el ConvexProvider en tu aplicación TanStack Start:
```ts
// src/root.tsx o src/router.tsx
---
description: Guidelines and best practices for building Convex projects, including database schema design, queries, mutations, and real-world examples
globs: `**/*.ts,**/*.tsx,**/*.js,**/*.jsx`
---
# Convex guidelines
## Function guidelines
### New function syntax
@vasco3
vasco3 / smallestDivisor
Created September 18, 2013 09:15
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
/*
2520 is the smallest number that can be divided by
each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly
divisible by all of the numbers from 1 to 20?
*/
@vasco3
vasco3 / ComponentWithRecipe.res
Created August 20, 2021 08:26
CSV Rescript recipe
let csvAtom = Recoil.atom({key: "csvAtom", default: Belt.Map.String.empty})
let headers = (
`codigo`,
`descripcion`,
`cantidad requerida`,
)
module CsvButton = {
type makeCsvData = {fields: array<string>, data: array<array<string>>}
@vasco3
vasco3 / If.js
Created August 5, 2020 11:06
If (React component)
const If = ({ children, orThis, it }) => {
return it ? children : orThis;
}
// usage example
<div>
<If it={age > 18} orThis={"🥤"}> 🍺 </If>
</div>
@vasco3
vasco3 / data.js
Last active December 8, 2020 04:35
Meal Planner
module.exports = [
{
_key: 'MEXICAN_TACOS',
_id: 'recipes/MEXICAN_TACOS',
_rev: '_XTqNHIW--_',
name: 'MEXICAN TACOS',
Calories: 150,
Fat: 5,
Carbs: 1,
Protein: 23,
@vasco3
vasco3 / If.js
Last active August 28, 2020 18:16
Fauna blog post
const If = ({ children, orThis, it }) => {
return it ? children : orThis;
}
// usage example
<div>
<If it={age > 18} orThis={"🥤"}> 🍺 </If>
</div>
@vasco3
vasco3 / HTML5 canvas ex1
Created October 3, 2013 01:33
Playing with OOP JS to draw an image in HTML Canvas
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var imgs = {
"spaceShip" : document.getElementById("space"),
"scream" : document.getElementById("scream")
}
function Scene(context, width, height, images){
this.context = context;
this.width = width;