Skip to content

Instantly share code, notes, and snippets.

View vasco3's full-sized avatar

Gorka Cesium vasco3

View GitHub Profile
@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;
@vasco3
vasco3 / blockstack
Created April 21, 2018 05:33
blockstack
Verifying my Blockstack ID is secured with the address 14eYnieZ5LhYJGU4W6CXnvXdVsBGExJ78S https://explorer.blockstack.org/address/14eYnieZ5LhYJGU4W6CXnvXdVsBGExJ78S
@vasco3
vasco3 / fibonacci
Created September 16, 2013 07:05
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
/*
euler
Each new term in the Fibonacci sequence is generated by adding the previous two terms.
By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not exceed four million,
find the sum of the even-valued terms.
*/
"scripts": {
"clean": "rm -rf build && mkdir build",
"build-css": "node-sass scss/app.scss public/css/app.css",
"build-server": "babel -d ./build ./server -s",
"build": "npm run clean && npm run build-css && npm run build-server",
"lint": "eslint source/ --quiet",
"start": "node ./build/index.js",
"debug": "node --debug ./build/index.js",
"test": "for i in $(ls tests/); do babel-node \"./tests/${i}\" | faucet ; done",
"validate": "npm run lint; npm run test && npm outdated --depth 0"