Skip to content

Instantly share code, notes, and snippets.

View mortegac's full-sized avatar
🏖️
Working from Miami Beach

Manuel Ortega Carcamo mortegac

🏖️
Working from Miami Beach
View GitHub Profile
@jdnichollsc
jdnichollsc / README.md
Last active June 8, 2020 06:41
React Native plugin for Mercado Pago (Mobile Checkout)

MercadoPago for React Native (Android & iOS)

A native bridge to use Mercado Pago SDK V4 with React Native.

import MercadoPago from 'react-native-mercado-pago';

async startPayment() {
  try {
    const publicKey = 'TEST-dc0b51e0-0eb7-47ce-b145-5585a0189eb0';
 const preferenceId = '113196323-082708db-09c3-4c7d-a65a-727e237c76e0';
@thibmaek
thibmaek / deploy-expo-ios.sh
Created June 21, 2018 21:43
CD for Expo RN applications
#! /usr/bin/env bash
set -e
# This is based on the expo blogpost:
# https://blog.expo.io/automating-standalone-expo-app-builds-and-deployments-with-fastlane-exp-and-exptool-9b2f5ad0a2cd
# Publish `production` release to Expo
function publish_expo() {
# Log into Expo when running in CI
# Locally you should already be logged in
@mortegac
mortegac / async-await.js
Last active April 16, 2020 16:54
Ejemplo del uso de Async Await para el manejo de Promesas
const fetch = require('node-fetch')
/**********************************************************************************
OPCION TRADICIONAL
**********************************************************************************/
function getNombre(username){
const url = `https://api.github.com/users/${username}`
fetch(url)
.then( res => res.json() )
.then( json => { console.log(json.name) })
@knowbody
knowbody / withGA.js
Created September 6, 2017 20:27
React Router with Google Analytics
import React from 'react';
import GoogleAnalytics from 'react-ga';
if (process.env.REACT_APP_ENVIRONMENT === 'production') {
GoogleAnalytics.initialize('UA-91111111-1');
}
const withGA = WrappedComponent => {
const trackPage = page => {
GoogleAnalytics.set({ page });
@radutzan
radutzan / Transantiago public endpoints.md
Last active April 14, 2026 18:28
APIs REST públicas con data del Transantiago. Respuestas en JSON.

Nuevo: SCLTransit

Ignacio Hermosilla implementó un servicio web de acceso público usando los feeds GTFS de Transantiago y los puntos de acceso oficiales que normalmente requieren acuerdos con el DTPM, para que tú no tengas que hacerlo.

Está toda la información de Transantiago que puedas necesitar, con formatos de alta calidad y sin trámites. Estas APIs son las que ahora alimentan a Cromi.

APIs internas de Transantiago (no recomendadas)

Transantiago implementó estas APIs para uso interno, por lo que no hay ninguna garantía sobre su funcionalidad, mantenimiento o futura existencia. Úsalas bajo tu propio riesgo. (Probablemente no es aconsejable que las uses para nada crítico.)

@knowbody
knowbody / App.js
Last active September 11, 2023 09:31
Check internet connection in React Native app
// quick snippet to check the connection in your RN app
// dispatches an `setIsConnected` action every time the NetInfo changes (on/off network)
componentDidMount() {
const dispatchConnected = isConnected => this.props.dispatch(setIsConnected(isConnected));
NetInfo.isConnected.fetch().then().done(() => {
NetInfo.isConnected.addEventListener('change', dispatchConnected);
});
}
@cletusw
cletusw / .eslintrc
Last active October 18, 2025 21:45
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names