Skip to content

Instantly share code, notes, and snippets.

@jacks205
jacks205 / App.js
Created Dec 5, 2017
Simplicity App Component for showing environment variables
View App.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from "react";
import { Platform, StyleSheet, Text, View } from "react-native";
import Config from "react-native-config";
@jacks205
jacks205 / build.gradle
Last active Nov 27, 2017
Simplicity app/build.gradle
View build.gradle
apply plugin: "com.android.application"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
@jacks205
jacks205 / RNMultipleTargetsInstructions.md
Last active Dec 18, 2021
Settings up multiple app targets in React-Native
View RNMultipleTargetsInstructions.md
View users.js
import API from '../api'
export const loginUser = (email, password) => API.post('/auth/signin', {}, {email, password})
export const retrieveCurrentUser = () => API.get('/user')
View api.js
import { Observable } from 'rxjs'
import axios from 'axios'
const API_BASE = '.sampleserve.net/api/v1'
const SUB_DOMAIN = 'test' // TODO: Add to store for other lab subdomains
const PROTOCOL = 'http'
/**
* @param {Object} Headers for HTTP request.
* @return {Object} Headers with `Accept` and `Content-Type` added.
View epics.js
import Rx from 'rxjs'
import { loginUser, retrieveCurrentUser } from '../api/users'
import { combineEpics } from 'redux-observable'
import {
LOGIN_USER, LOGIN_USER_CANCELLED, LOGIN_USER_SUCCESS,
RETRIEVE_CURRENT_USER, RETRIEVE_CURRENT_USER_CANCELLED
} from '../constants/UserActionTypes'
import {
loginUserSuccess, loginUserError,
retrieveCurrentUser as retrieveCurrentUserAction, retrieveCurrentUserSuccess, retrieveCurrentUserError
@jacks205
jacks205 / gist:56c4b539f937a807b1682f3920ad6e13
Created Oct 13, 2016 — forked from krzysztofzablocki/gist:4396302
Set symbol breakpoint on objc_msgSend then setup this debug command to log all methods called in iOS Simulator. If you want to do device debugging change esp+4 register to r0, esp+8 to r1 Found long ago somewhere on stackoverflow.
View gist:56c4b539f937a807b1682f3920ad6e13
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) )
View JSTableWithFixedHeaderViewController.m
// Key sections of code for this implementation are placed below
@interface JSTableWithFixedHeaderViewController ()
@property (strong, nonatomic) UIView *fixedHeaderView;
@end
@implementation JSTableWithFixedHeaderViewController
View ValidationView.swift
//: Playground - noun: a place where people can play
import UIKit
let view = UIView(frame: CGRectMake(0,0,286,54))
view.backgroundColor = UIColor.clearColor()
let label = UILabel(frame: CGRectMake(24,8,238,32))
label.textColor = UIColor.redColor()
label.text = "That email address is already taken! Try a different email address."
View VideoDataSource.java
package com.jacks205.mediadatasourceexample;
import android.media.MediaDataSource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
public class VideoDataSource extends MediaDataSource {