Skip to content

Instantly share code, notes, and snippets.

🏠
Yolo.

Mateusz Zatorski knowbody

🏠
Yolo.
View GitHub Profile
View typescript_example.tsx
type Message = {
id: number;
body: string;
}
type State = {
messages: Message[]
}
const messages: Message[] = [
@knowbody
knowbody / rentalPlacesData.json
Created Sep 3, 2018
Example data for RN Fundamentals Workshop
View rentalPlacesData.json
[
{
"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"
},
View .flow_config
[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/.*
View index.js
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
Example `App.re` Reason React Native
View App.re
open BsReactNative;
/* here we define some styles */
module Styles = {
open Style;
let container =
style([
flex(1.),
justifyContent(Center),
@knowbody
knowbody / grid.css
Created Oct 31, 2017
Grid cards example
View grid.css
.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 Sep 6, 2017
React Router with Google Analytics
View withGA.js
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 });
View dropdownOptions.js
/* @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
Zeit now.sh and CircleCI config
View circle.yml
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
now.sh deployment CircleCI
View circle.yml
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})
You can’t perform that action at this time.