Skip to content

Instantly share code, notes, and snippets.

@tgoldenberg
tgoldenberg / styles.js
Last active August 31, 2016 03:37
StyleSheet for Build React Native tutorial
import Colors from './colors';
import { Dimensions, StyleSheet } from 'react-native';
const { height: deviceHeight, width: deviceWidth } = Dimensions.get('window');
export const profileStyles = StyleSheet.create({
flexRow: {
backgroundColor: 'white',
flexDirection: 'row',
justifyContent: 'center',
@tgoldenberg
tgoldenberg / index.js
Last active July 25, 2016 03:44
fixtures for Assemblies Tutorial
import _ from 'underscore';
export const FAKE_USERS = [
{ id: 0, firstName: 'Paul', lastName: 'Graham', avatarUrl: 'https://pbs.twimg.com/profile_images/1824002576/pg-railsconf_400x400.jpg' },
{ id: 1, firstName: 'Dan', lastName: 'Abramov', avatarUrl: 'https://pbs.twimg.com/profile_images/553711083064541184/9VsY9i09.jpeg' },
{ id: 2, firstName: 'Marc', lastName: 'Andreessen', avatarUrl: 'https://pbs.twimg.com/profile_images/649108987128868864/rWnwMe55.jpg'},
{ id: 3, firstName: 'Nick', lastName: 'Brown', avatarUrl: 'https://pbs.twimg.com/profile_images/652242629556609024/nRgVcSMq.jpg'},
{ id: 4, firstName: 'Brent', lastName: 'Vatne', avatarUrl: 'https://codecore.ca/assets/team/brent-5b7ed4ae6cedceb4e5a7df9ba1fada5e.jpg'},
{ id: 5, firstName: 'Kanye', lastName: 'West', avatarUrl: 'https://pbs.twimg.com/profile_images/585565077207678977/N_eNSBXi.jpg'},
];
@tgoldenberg
tgoldenberg / package.json
Created February 11, 2016 00:56
Packages
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
meteor-base # Packages every Meteor app needs to have
mobile-experience # Packages for a great mobile UX
mongo # The database Meteor supports right now
blaze-html-templates # Compile .html files into Meteor Blaze views
@tgoldenberg
tgoldenberg / index.ios.js
Created February 9, 2016 13:13
RN Index file
import React from 'react-native';
import DeviceInfo from 'react-native-device-info';
let clientId = DeviceInfo.getUniqueID();
class gita extends React.Component{
componentDidMount(){
NativeModules.AnalyticsHelper.identify(clientId);
}
_login(){
NativeModules.AnalyticsHelper.login(clientId);
@tgoldenberg
tgoldenberg / AnalyticsHelper.m
Created February 9, 2016 04:16
Analytics logic
//
// AnalyticsHelper.m
// assembly
//
// Created by Thomas Goldenberg on 2/8/16.
// Copyright © 2016 Facebook. All rights reserved.
//
#import "AnalyticsHelper.h"
#import <Analytics/SEGAnalytics.h>
@tgoldenberg
tgoldenberg / AnalyticsHelper.h
Created February 9, 2016 03:58
Analytics Header File
#import "RCTViewManager.h"
#import "RCTBridgeModule.h"
@interface AnalyticsHelper : NSObject <RCTBridgeModule>
@end
@tgoldenberg
tgoldenberg / AppDelegate.m
Last active February 9, 2016 03:42
Main RN File with Integrations
#import "AppDelegate.h"
#import <Analytics/SEGAnalytics.h>
#import <Segment-GoogleAnalytics/SEGGoogleAnalyticsIntegrationFactory.h>
#import <Segment-Branch/BNCBranchIntegrationFactory.h>
#import <Segment-Localytics/SEGLocalyticsIntegrationFactory.h>
#import "RCTRootView.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
@tgoldenberg
tgoldenberg / AppDelegate.m
Created February 9, 2016 01:12
Main RN file
#import "AppDelegate.h"
#import <Analytics/SEGAnalytics.h>
#import "RCTRootView.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[SEGAnalytics setupWithConfiguration:[SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY"]];
@tgoldenberg
tgoldenberg / podfile
Last active February 21, 2016 23:52
podfile for Segment Analytics
# Uncomment this line to define a global platform for your project
platform :ios, '9.1'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'gita' do
pod 'Analytics'
pod 'Segment-GoogleAnalytics'
pod 'Segment-Branch'
pod 'Segment-Localytics'
@tgoldenberg
tgoldenberg / segment-analytics.m
Last active May 9, 2018 23:35
Segment Analytics for React Native
# AppDelegate.m
#import <Analytics/SEGAnalytics.h>
[SEGAnalytics setupWithConfiguration:[SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_ANALYTICS_KEY_HERE"]];
# AnalyticsHelper.h
#import "RCTViewManager.h"
#import "RCTBridgeModule.h"