This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ROM = [ | |
{key:"M",value:1000}, | |
{key:"D",value:500}, | |
{key:"C",value:100}, | |
{key:"L",value:50}, | |
{key:"X", value:10}, | |
{key:"V",value:5}, | |
{key:"I",value:1} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<View style={{flex:1, flexDirection: 'row'}}> | |
<View style={Styles.headline}> | |
<Text style={{fontSize: 17, color: "#fff"}}>Use an Existing Profile:</Text> | |
<ScrollView> | |
{ myProfiles.map(this._renderMyProfiles) } | |
</ScrollView> | |
</View> | |
</View> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Row flex> | |
<View dial={5}> | |
<Text fontSize={17} color="#fff">Use an Existing Profile:</Text> | |
<ScrollView> | |
{ myProfiles.map(this._renderMyProfiles) } | |
</ScrollView> | |
</View> | |
</Row> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import RN from 'react-native'; | |
// http://stackoverflow.com/questions/32947036/how-to-set-font-size-for-different-ios-devices-in-react-native | |
import { getCorrectFontSizeForScreen } from '../services/Design'; | |
const RNText = RN.Text; | |
const Platform = RN.Platform; | |
const FONTS = Platform.OS === 'ios' ? { | |
'light': 'AvenirNext-Light', | |
'regular':'AvenirNext-Regular', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine | |
from sqlalchemy.ext.declarative import declarative_base, DeferredReflection | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
connection_string = << your connection string here >> | |
engine = create_engine(connection_string) | |
db_session = scoped_session(sessionmaker(autocommit=False, | |
autoflush=False, | |
bind=engine)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import Column, Integer, ForeignKey | |
from sqlalchemy.orm import relationship | |
from database import Base | |
class PersonModel(Base): | |
__tablename__ = 'person' | |
uuid = Column(Integer, primary_key=True) | |
Articles = relationship("ArticleModel") | |
class ArticleModel(Base): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from database import db_session | |
from flask_graphql import GraphQLView | |
from schema import schema | |
app = Flask(__name__) | |
app.debug = True | |
app.add_url_rule('/graphql', view_func=GraphQLView.as_view('graphql', schema=schema, graphiql=True, context={'session': db_session})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import graphene | |
from graphene_sqlalchemy import SQLAlchemyConnectionField, SQLAlchemyObjectType | |
from models import * | |
class Person(SQLAlchemyObjectType): | |
class Meta: | |
model = PersonModel | |
interfaces = (graphene.relay.Node, ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
class UpdatePersonName(graphene.Mutation): | |
class Input: | |
uuid = graphene.Int(required=True) | |
name = graphene.String(required=True) | |
person = graphene.Field(Person) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { TextInput, View } from 'react-native' | |
import defaultTheme from './theme' | |
const Input = ({inlineLabel}) => ( | |
const styles = { | |
inlineWrapper: { | |
flex: inlineLabel ? .5 : 1, | |
height: inlineLabel ? theme.FormGroup.height - theme.FormGroup.borderWidth*2 : theme.FormGroup.height, |
OlderNewer