Skip to content

Instantly share code, notes, and snippets.

View bacarybruno's full-sized avatar
💭
Think Simple

Bacary Bruno Bodian bacarybruno

💭
Think Simple
View GitHub Profile
echo "Updating Angular CLI globally."
npm install -g @angular/cli
echo "Updating Angular CLI locally."
npm install @angular/cli
echo "Migrating the configuration to the new angular.json."
ng update @angular/cli
echo "Updating all packages to v6"
ng update @angular/core
echo "Using ng update to identify and update other dependencies."
ng update --all --force
@bacarybruno
bacarybruno / cloudSettings
Created March 11, 2019 10:41
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-07-10T17:38:51.815Z","extensionVersion":"v2.9.2"}
@bacarybruno
bacarybruno / eslintrc-react.json
Created March 11, 2019 10:41
ESLint file for react, with best practices and extending airbnb config.
{
"root": true,
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"es6": true,
"node": true,
"jest": true
},
"plugins": [
@bacarybruno
bacarybruno / create-rn-project.sh
Created March 11, 2019 10:41
Create React Native project with base packages (redux and icons) and code recommanded structure.
cd ..
react-native init YourAwesomeProject
cd YourAwesomeProject
react-native run-android
yarn remove react-native
yarn add react-native@0.55.4
yarn remove babel-preset-react-native
yarn add babel-preset-react-native@4.0.0
yarn add prop-types react-native-vector-icons redux redux-logger redux-persist redux-saga
yarn add -D babel-core@latest babel-loader@latest eslint eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-import eslint-plugin-react flow-bin flow-typed jest react-test-renderer
{
"name": "YourAwesomeProject",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"watch": "nodemon node_modules/react-native/local-cli/cli.js start",
"eslint-init": "eslint --init",
"flow": "flow",
"test": "yarn jest && flow && eslint .",
// Based on the amazing work on https://ethercreative.github.io/react-native-shadow-generator/
// https://github.com/ethercreative/react-native-shadow-generator
const penumbra = [
'0px 1px 1px 0px',
'0px 2px 2px 0px',
'0px 3px 4px 0px',
'0px 4px 5px 0px',
'0px 5px 8px 0px',
'0px 6px 10px 0px',
Resources:
NodeSecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
GroupDescription: Enable HTTP access via port 3000
SecurityGroupIngress:
-
IpProtocol: tcp
FromPort: 3000
ToPort: 3000
// Keep in sync with
// https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/cupertino/colors.dart
export default {
black: 'rgba(0, 0, 0, 255)',
white: 'rgba(255, 255, 255, 255)',
systemBlue: {
light: 'rgba(0, 122, 255, 255)',
dark: 'rgba(10, 132, 255, 255)',
},
import { useEffect, useState, useContext } from 'react'
import { NavigationContext } from 'react-navigation'
export const useNavigation = () => {
const navigation = useContext(NavigationContext)
if (!navigation) {
throw new Error('navigation object not found. Please make sure your component is in a navigation tree')
}
return navigation
}
import { ref, watch, onBeforeUnmount } from 'vue';
export const useState = (initialValue) => {
const state = ref(initialValue);
const setState = (value) => {
state.value = value;
};
return [state, setState];
};