Skip to content

Instantly share code, notes, and snippets.

View david-arteaga's full-sized avatar

David Arteaga david-arteaga

View GitHub Profile
@david-arteaga
david-arteaga / add-ts.sh
Last active February 27, 2018 03:53
Add typescript to a React Native project
#!/bin/bash
# Install dependencies
#
npm i
# Move source files into src directory
#
mkdir src
mv index.js src/
Clase alcances y limitaciones
Alcance: indicar qué vas a hacer, lo que hay detrás es indicar qué es lo que no vas a hacer
Delimitación del problema -> delimitar el proyecto
Alcance -> dentro del alcance está la delimitación != Limitación
Alcance = Delimitación != Limitación <— Obstáculo
Obstáculo lleva a una limitación
Limitación: situaciones en las que el proyecto depende de terceros
{
"window.zoomLevel": 0,
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.tabSize": 2,
"files.insertFinalNewline": true,
"editor.formatOnSave": true,
"editor.fontLigatures": true,
"bracketPairColorizer.forceIterationColorCycle": true,
"gitlens.advanced.messages": {
{
// Place your snippets for typescriptreact here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@david-arteaga
david-arteaga / solution.md
Last active February 17, 2019 16:07
[[!] [Xcodeproj] Generated duplicate UUIDs:] #reactnative #cocoapods #dependencies
@david-arteaga
david-arteaga / InitialNnavigator.ts
Created February 18, 2019 19:41
[React navigation modal disable gestures] #reactnative #reactnavigation
const InitialNavigator = createStackNavigator(
{
Login: LoginScreen,
Registration: {
screen: RegistrationScreen,
navigationOptions: { gesturesEnabled: false },
},
RecoverPassword: {
screen: RecoverPasswordScreen,
navigationOptions: { gesturesEnabled: false },
@david-arteaga
david-arteaga / docker-compose-postgres.yml
Created March 22, 2019 13:17
[Postgres docker-compose]
version: '3.3'
services:
followme-postgres:
# image: postgres:10.7-alpine # just postgres
image: mdillon/postgis:10-alpine # with postgis
restart: always
environment:
POTSGRES_PASSWORD: postgres
POSTGRES_USER: postgres
@david-arteaga
david-arteaga / 1. README.md
Last active March 29, 2019 16:41
Dataloader helpers for apollo server

This is a set of functions that could be used as helpers for the Dataloader (https://github.com/graphql/dataloader). The helpers are designed to handle two cases:

  1. Batching fetches when each key corresponds to a single value (think userId -> User)
  2. Batching fetches when each key corresponds to multiple values (think userId -> userPosts)

One item per key

For the first case, there is the mapKey function.

It wraps the batch loading function to make sure it always returns an array the same length as the keys array and with items in the same order as the keys.