Skip to content

Instantly share code, notes, and snippets.

View vasco3's full-sized avatar

Gorka Cesium vasco3

View GitHub Profile
@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
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 / 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 / blockstack
Created April 21, 2018 05:33
blockstack
Verifying my Blockstack ID is secured with the address 14eYnieZ5LhYJGU4W6CXnvXdVsBGExJ78S https://explorer.blockstack.org/address/14eYnieZ5LhYJGU4W6CXnvXdVsBGExJ78S
const PERMITTED_REORDER = 0b1111010111;  // acceptableState

contactEmail: 1        // 0b0000000001   t
contactName: 2       // 0b0000000010   t
contactPhone: 4      // 0b0000000100   t
deliveryWindow: 8  // 0b0000001000    false
endDate: 16            // 0b0000010000    t
jobsiteAddress: 32 // 0b0000100000 false
@vasco3
vasco3 / initctl.js
Created March 25, 2016 17:54
Trigger initctl processes with NodeJS
var exec = require('child_process').exec;
var child;
var listCmd = 'initctl list | ag ' + process.argv[2];
exec(listCmd, function (error, stdout, stderr) {
if (error !== null) { console.log('exec listCmd error', error); }
var rows = stdout.split('\n');
@vasco3
vasco3 / src.js.map
Last active February 25, 2016 20:06
{"version":3,"names":[],"mappings":"","sources":["quotelog.js"],"sourcesContent":["!function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u=\"function\"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var d=new Error(\"Cannot find module '\"+a+\"'\");throw d.code=\"MODULE_NOT_FOUND\",d}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i=\"function\"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){\"use strict\";function r(e){return e&&e.__esModule?e:{\"default\":e}}function o(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function i(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e._
@vasco3
vasco3 / file.md
Last active February 11, 2016 22:23

App Structure

Mono repository for all apps. Instead of having ConeZone in npm we would have it on the root of the repo.

Pros

  • Easier iteration
  • Less overhead

Versioning

named folder based

Directory structure

/button/v1.0/
/button/v1.0.1/
/button/v1.0.2/