Skip to content

Instantly share code, notes, and snippets.

@ThrowJojo
ThrowJojo / MainActivity.kt
Created September 25, 2017 04:24
Put it all together
package com.aproject
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.os.PersistableBundle
import android.view.WindowManager
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
@ThrowJojo
ThrowJojo / tracker.js
Created October 9, 2017 04:15
Example of GoogleAnalyticsTracker
import { GoogleAnalyticsTracker } from "react-native-google-analytics-bridge";
let tracker = new GoogleAnalyticsTracker("UA-12345678-9");
tracker.trackScreenView("Home");
@ThrowJojo
ThrowJojo / Widget.dart
Created October 16, 2017 01:11
Example of initState
@override
void initState() {
super.initState();
scheduleMicrotask(this.transition);
}
transition() {
// Logic
}
@ThrowJojo
ThrowJojo / Widget.dart
Created October 16, 2017 01:12
Example of initState.
@override
void initState() {
super.initState();
this.transition();
}
transition() async {
// Logic
}
@ThrowJojo
ThrowJojo / install.sh
Created October 20, 2017 01:41
Install iOS deploy with npm
npm install -g ios-deploy
@ThrowJojo
ThrowJojo / run_ios.sh
Created October 20, 2017 01:43
Run React Native on iOS device
react-native run-ios --device "[DEVICE NAME]"
@ThrowJojo
ThrowJojo / run.sh
Created October 20, 2017 01:44
Run on Jordan's iPhone
react-native run-ios --device "Jordan's iPhone"
@ThrowJojo
ThrowJojo / script.js
Created October 25, 2017 05:15
ReactDOM rendering
<script>
window.onload = function () {
ReactDOM.render(
React.createElement(Container, { discountCode: "20OFF", style: { backgroundColor: 'transparent', paddingTop: 190, paddingBottom: 50 } }),
document.getElementById('react-container')
);
};
</script>
@ThrowJojo
ThrowJojo / render.js
Created November 3, 2017 00:40
ReactDOM rendering1
ReactDOM.render(
<MyComponent />,
document.getElementById('component-container')
);
@ThrowJojo
ThrowJojo / render.js
Created November 3, 2017 00:41
ReactDOM rendering 2
ReactDOM.render(
<MyComponent />,
document.getElementById('component-container')
);
ReactDOM.render(
<MyComponent />,
document.getElementById('component-container2')
);