Skip to content

Instantly share code, notes, and snippets.

@thekevinscott
thekevinscott / imagenet1000_clsid_to_human.txt
Created August 1, 2018 16:55 — forked from yrevar/imagenet1000_clsidx_to_labels.txt
text: imagenet 1000 class id to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',

Keybase proof

I hereby claim:

  • I am thekevinscott on github.
  • I am thekevinscott (https://keybase.io/thekevinscott) on keybase.
  • I have a public key ASC2HXmTRb84v0rWrVO2bXc1SAHDMfMj2lHoM0cebP8XFAo

To claim this, I am signing this object:

@thekevinscott
thekevinscott / basic-image.js
Created April 28, 2017 17:30
A basic example of an absolutely positioned <Image /> in React Native
import React, { Component } from 'react';
import {
AppRegistry,
Image,
} from 'react-native';
const remote = 'https://s15.postimg.org/tw2qkvmcb/400px.png';
export default class BackgroundImage extends Component {
render() {
@thekevinscott
thekevinscott / image-with-text.js
Created April 28, 2017 17:30
Example of an absolutely positioned <Image /> with text overlaid in React Native
import React, { Component } from 'react';
import {
AppRegistry,
Image,
Text,
} from 'react-native';
const remote = 'https://s15.postimg.org/tw2qkvmcb/400px.png';
export default class BackgroundImage extends Component {
@thekevinscott
thekevinscott / absolute-image.js
Created April 28, 2017 17:29
Example of absolutely positioning a background <Image /> with React Native
import React, { Component } from 'react';
import {
AppRegistry,
Image,
View,
Text,
} from 'react-native';
const remote = 'https://s15.postimg.org/tw2qkvmcb/400px.png';
import React from 'react';
import {
StyleSheet,
View,
TextInput,
AppRegistry,
} from 'react-native';
class App extends React.Component {
constructor(props) {
// http://www.2ality.com/2013/09/javascript-unicode.html
function toUTF16(codePoint) {
var TEN_BITS = parseInt('1111111111', 2);
function u(codeUnit) {
return '\\u'+codeUnit.toString(16).toUpperCase();
}
if (codePoint <= 0xFFFF) {
return u(codePoint);
}
// From string to decimal code point
'A'.codePointAt(0)
> 65
// From decimal to hexadecimal code point
Number(65).toString(16);
> 41
// From hexadecimal to decimal code point
parseInt('41',16)
const patchedConnect = (...args) => component => {
const componentName = component.name;
const mapStateToProps = ({ router }) => {
const {
scene,
} = router;
return {
activeComponent: (scene || {}).title,
import typeToReducer from 'type-to-reducer';
import {
ActionConst,
} from 'react-native-router-flux';
const initialState = {
scene: {
name: 'Games Overview',
key: 'Games Overview',
title: 'Games Overview',