Skip to content

Instantly share code, notes, and snippets.

View shokimble's full-sized avatar

Kimble Young shokimble

  • Everywhere
View GitHub Profile
@shokimble
shokimble / vjs-friendlyerrors-plugin.js
Created September 28, 2016 06:52
Brightcove customise error messages
//Custom errors
//Documented here http://docs.brightcove.com/en/perform/brightcove-player/guides/errors-plugin.html
(function(videojs) {
var defaults = {
errors: {
1: {
type: "MEDIA_ERR_ABORTED",
headline: "The video connection was lost",
message: "Please check your internet connection and try again",
},
package com.tshirtdesignernavredux;
import java.util.ArrayList;
import java.util.List;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.react.bridge.ModuleSpec;
import com.facebook.react.modules.network.NetworkingModule;
import com.facebook.react.modules.network.NetworkingModuleUtils;
package com.facebook.react.modules.network;
import com.facebook.react.bridge.ReactApplicationContext;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
/*
//You should already have initialised your stack navigator and named it AppNavigator (you can call it something else just change all the references)
//eg.
const AppNavigator = StackNavigator(
Routes
);
*/
//works for some NFI reason http://mkumaran.net/blog/2018/03/create-3d-model-in-react-native-using-webgl-and-three-js/
import React, { Component } from "react";
import { Platform, StyleSheet, Text, View } from "react-native";
import { WebGLView } from "react-native-webgl";
import 'react-native-console-time-polyfill';
import THREE from "./three";
@shokimble
shokimble / observable.js
Created July 29, 2018 16:54
observable
import {View} from 'react-native';
import React, { Component } from 'react';
function randomColor() {
return '#'+Math.floor(Math.random()*16777215).toString(16);
}
export default class HelloWorld extends Component {
constructor() {
/* Header that shrinks up and to the center as you scroll
To use pass in the onscroll event of a scrollview or something similar and the rest is handled
*/
import React, { Component } from 'react';
import { Text, View, StyleSheet, Dimensions, Animated, ScrollView } from 'react-native';
import PropTypes from 'prop-types';
import GlobalStyles from '../styles';