Skip to content

Instantly share code, notes, and snippets.

View rcerrejon's full-sized avatar

Rafael Cerrejon rcerrejon

View GitHub Profile
@rcerrejon
rcerrejon / consolelog.code-snippets
Created January 30, 2020 15:08
console log snippet for javascript and typescript
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. 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 with string": {
@rcerrejon
rcerrejon / swipe.js
Created November 13, 2019 08:17
swipe React Function
import React, { Component } from 'react'
import { View, Animated, PanResponder } from 'react-native'
// onSwipePerformed = action => {
// switch (action) {
// case 'left': {
// // this.switchTo(1)
// console.log('left Swipe performed')
// break
// }
@rcerrejon
rcerrejon / requestHelper.ts
Last active June 3, 2019 12:31
React Hook API Fetch Helper with axios and Typescript
import { useState, useEffect, useReducer } from 'react'
import axios from 'axios'
/* eslint-disable react-hooks/rules-of-hooks */
type Action =
| { type: 'FETCH_INIT'; payload: [] }
| { type: 'FETCH_SUCCESS'; payload: [] }
| { type: 'FETCH_FAILURE'; payload: [] }
@rcerrejon
rcerrejon / RCTLinkingManager.h
Created April 16, 2019 13:53
RN - Nullable Build Error Fix
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import <React/RCTEventEmitter.h>
@rcerrejon
rcerrejon / terminal.sh
Created February 25, 2019 16:06
thirdparty xcode 10 Problem
cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../ && cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../
@rcerrejon
rcerrejon / style.js
Created January 30, 2019 13:23
Vertical and horizontal Component in React Native
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
@rcerrejon
rcerrejon / svn
Created June 28, 2017 10:45
SVN copy from Trunk to a new Branch
svn copy http://URLTO/trunk http://URLTO/branches/BRANCHNAME -m "first commit"
@rcerrejon
rcerrejon / appstore.jsx
Created June 27, 2017 14:40
Link to Appstore/GooglePlay
let urlStore = 'iTunes Link';
if (Platform.OS === 'android') {
urlStore = 'Google Play Link';
}
Alert.alert(
'Appstore / Google Play',
'Linking to Store',
[{
text: 'OK',
onPress: () => Linking
@rcerrejon
rcerrejon / atom_packages
Last active May 23, 2017 13:04
Atom full package set to develop in React/React Native
apm install atom-beautify autoclose-html highlight-selected language-babel linter linter-eslint minimap minimap-highlight-selected pigments seti-ui monokai-seti
Atom-beautify: Ctrl+Alt+B
Minimap: Absolute Mode: True
Seti UI: Compact Mode: True
@rcerrejon
rcerrejon / npm
Last active May 30, 2017 14:09
Clean and restart full dependencies node_modules etc...
watchman watch-del-all && yarn upgrade && yarn cache clean && npm start --reset-cache