Skip to content

Instantly share code, notes, and snippets.

View knowbody's full-sized avatar
🏠
Yolo.

Mateusz Zatorski knowbody

🏠
Yolo.
View GitHub Profile
type Message = {
id: number;
body: string;
}
type State = {
messages: Message[]
}
const messages: Message[] = [
@knowbody
knowbody / rentalPlacesData.json
Created September 3, 2018 14:00
Example data for RN Fundamentals Workshop
[
{
"id": "08fa1f2d-5fea-4da1-b2bc-edf1b69b3e6e",
"type": "house",
"price": "$1936",
"size": 101,
"rating": 4,
"location": "Vista Hermosa",
"image": "https://images.unsplash.com/photo-1525896544042-354764aa27e6?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=bb22e6f49db10bc0c0c8efda661a1349&auto=format&fit=crop&w=668&q=80"
},
[ignore]
; We fork some components by platform
./[.]android.js
; Ignore templates for 'react-native init'
<PROJECT_ROOT>/node_modules/react-native/local-cli/templates/.*
; Ignore RN jest
<PROJECT_ROOT>/node_modules/react-native/jest/.*
import { AppRegistry } from 'react-native';
import { app } from './src/App';
/*
if the "in-source" option is false (the defualt), you will import app this way:
import { app } from "./lib/js/src/App.js";
*/
AppRegistry.registerComponent('MyReasonApp', () => app);
@knowbody
knowbody / App.re
Created May 28, 2018 08:22
Example `App.re` Reason React Native
open BsReactNative;
/* here we define some styles */
module Styles = {
open Style;
let container =
style([
flex(1.),
justifyContent(Center),
@knowbody
knowbody / grid.css
Created October 31, 2017 15:44
Grid cards example
.grid {
display: grid;
height: 100%;
grid-template-columns: 2rem repeat(2, auto) 2rem;
grid-template-rows: 4rem 4rem auto;
background-color: #fff;
}
.layer1 {
background-color: rgb(64, 213, 187);
@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 });
/* @flow */
type UserTitleOptionT = 'Miss' | 'Mrs' | 'Mr' | 'Ms' | 'Dr';
export const USER_TITLE_OPTIONS: Array<{
id: UserTitleOptionT,
value: UserTitleOptionT
}> = [
{ id: 'Miss', value: 'Miss' },
{ id: 'Mrs', value: 'Mrs' },
{ id: 'Mr', value: 'Mr' },
@knowbody
knowbody / circle.yml
Created May 31, 2017 07:59
Zeit now.sh and CircleCI config
machine:
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
node:
version: 7.10.0
dependencies:
override:
- yarn
cache_directories:
@knowbody
knowbody / circle.yml
Created May 23, 2017 17:09
now.sh deployment CircleCI
deployment:
development:
branch: master
commands:
- URL=$(now -t ${NOW_TOKEN})
- now -t ${NOW_TOKEN} alias set ${URL} eedi-dev.now.sh
production:
branch: production
commands:
- URL=$(now -t ${NOW_TOKEN})