Skip to content

Instantly share code, notes, and snippets.

@dereknelson
dereknelson / projectTaskGroupActions.js
Created February 10, 2020 19:49
redux normalization
import * as constants from '../Constants'
export const fetchProjectTaskGroups = payload => ({
type: constants.FETCH_PROJECT_TASK_GROUPS.TRIGGER,
payload,
})
export const addTaskGroupToFetchQueue = payload => ({
type: constants.ADD_TASK_GROUP_TO_FETCH_QUEUE,
payload,
@dereknelson
dereknelson / tsserver.log
Created January 9, 2020 23:05
TS Server log
Info 1084 [17:40:47.123] -----------------------------------------------
Info 1084 [17:40:47.123] Open files:
Info 1084 [17:40:47.123] FileName: /Users/derek/mosaic/mosaic-mobile/src/Redux/Actions/initializationActions.js ProjectRootPath: /Users/derek/mosaic/mosaic-mobile
Info 1084 [17:40:47.123] Projects: /dev/null/inferredProject1*
Info 1084 [17:40:47.123] FileName: /Users/derek/mosaic/mosaic-mobile/src/Sagas/helpers.js ProjectRootPath: /Users/derek/mosaic/mosaic-mobile
Info 1084 [17:40:47.123] Projects: /dev/null/inferredProject1*
Info 1084 [17:40:47.123] FileName: /Users/derek/mosaic/mosaic-mobile/src/Redux/Actions/tasksListActions.js ProjectRootPath: /Users/derek/mosaic/mosaic-mobile
Info 1084 [17:40:47.123] Projects: /dev/null/inferredProject1*
Info 1084 [17:40:47.123] FileName: /Users/derek/mosaic/mosaic-mobile/node_modules/react-native-offline/src/redux/createNetworkMiddleware.js ProjectRootPath: /Users/derek/mosaic/mosaic-mobile
Info 1084 [17:40:47.123] Projects: /dev/null/inferredProjec
@dereknelson
dereknelson / tsserver.log
Created January 9, 2020 23:05
TS Server log
Info 1084 [17:40:47.123] -----------------------------------------------
Info 1084 [17:40:47.123] Open files:
Info 1084 [17:40:47.123] FileName: /Users/derek/mosaic/mosaic-mobile/src/Redux/Actions/initializationActions.js ProjectRootPath: /Users/derek/mosaic/mosaic-mobile
Info 1084 [17:40:47.123] Projects: /dev/null/inferredProject1*
Info 1084 [17:40:47.123] FileName: /Users/derek/mosaic/mosaic-mobile/src/Sagas/helpers.js ProjectRootPath: /Users/derek/mosaic/mosaic-mobile
Info 1084 [17:40:47.123] Projects: /dev/null/inferredProject1*
Info 1084 [17:40:47.123] FileName: /Users/derek/mosaic/mosaic-mobile/src/Redux/Actions/tasksListActions.js ProjectRootPath: /Users/derek/mosaic/mosaic-mobile
Info 1084 [17:40:47.123] Projects: /dev/null/inferredProject1*
Info 1084 [17:40:47.123] FileName: /Users/derek/mosaic/mosaic-mobile/node_modules/react-native-offline/src/redux/createNetworkMiddleware.js ProjectRootPath: /Users/derek/mosaic/mosaic-mobile
Info 1084 [17:40:47.123] Projects: /dev/null/inferredProjec
@dereknelson
dereknelson / chat.js
Last active June 18, 2019 22:31
sendbird mounting
var sb = null;
export default class Chat extends Component {
constructor(props) {
super(props);
sb = SendBird.getInstance();
this.state = {
channel: props.channel, channelUrl: props.channelUrl, name: props.name, messageQuery: '', channel: '', name: '', messages: props.channel.messageList || [],
};
}
{
"name": "convertnote",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "nodemon --exec babel-node src/server.js",
"build": "babel src --out-dir dist",
"serve": "node dist/server.js"
},
@dereknelson
dereknelson / store.js
Created April 26, 2019 00:39
redux profiler
//...store logic
// profiler for redux actions
const userTiming = (store) => (next) => (action) => {
if (performance.mark === undefined) return next(action)
performance.mark(`${action.type}_start`);
const result = next(action);
performance.mark(`${action.type}_end`);
performance.measure(`${action.type}`,`${action.type}_start`,`${action.type}_end`,)
return result
@dereknelson
dereknelson / AppDelegate.m
Created April 17, 2019 18:22
AppDelegate
// Copyright 2015-present 650 Industries. All rights reserved.
#import "AppDelegate.h"
#import <React/RCTPushNotificationManager.h>
#import <RadarSDK/RadarSDK.h>
@implementation AppDelegate
// Put your app delegate methods here. Remember to also call methods from EXStandaloneAppDelegate superclass
// in order to keep Expo working. See example below.
@dereknelson
dereknelson / backgroundLocationTasks.js
Last active September 3, 2019 18:39
background location config
import { Permissions, Location, TaskManager, Notifications } from 'expo'
import axios from 'axios'
export const BACKGROUND_LOCATION_UPDATES_TASK = 'background-location-updates'
export const BACKGROUND_GEOFENCING_UPDATES_TASK = 'background-geofencing-updates'
const geofences = [] //I get this from the server, omitted for sake of clarity
const url = 'api.metoo.io'
TaskManager.defineTask(BACKGROUND_LOCATION_UPDATES_TASK, handleLocationUpdate)
TaskManager.defineTask(BACKGROUND_GEOFENCING_UPDATES_TASK, handleGeofencingUpdate)
@dereknelson
dereknelson / ViewRequisition.js
Created January 6, 2019 19:44
ViewRequisition help
import React, { Component } from 'react';
import { StyleSheet, ListView, AsyncStorage, Alert, FlatList } from "react-native";
import {
Container,
Body,
Content,
Header,
Left,
Right,
List,
@dereknelson
dereknelson / NavBar.js
Created May 9, 2018 00:34
Navigation Wrapper for screens
import React, { Component, PureComponent } from 'react';
import { View, Text, FlatList, TouchableOpacity, RefreshControl, Image, Alert, Dimensions, StyleSheet, Platform, Keyboard } from 'react-native';
import { SafeAreaView } from 'react-navigation'
import { connect } from 'react-redux'
import Colors from '../../../constants/Colors';
import BackIcon from 'react-native-vector-icons/Ionicons';
const ios = Platform.OS == 'ios'