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 requests | |
import json | |
# an example url, which actually returns JSON | |
url = "https://crawler.goodfind.com.tw/d/E0pvWZk1" | |
# this is how to do HTTP GET | |
r = requests.get(url) | |
# print returned content |
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, { Component } from 'react' | |
import { Alert, ListView, BackHandler, FlatList } from 'react-native' // add Alert and ListView | |
import { Container, Text, Header, Content, Form, Item, Input, Label, Button, Icon, Picker, List, ListItem, Thumbnail, Body, Spinner } from 'native-base'; | |
import { connect } from 'react-redux' | |
// Add Actions - replace 'Your' with whatever your reducer is called :) | |
// import YourActions from '../Redux/YourRedux' | |
// Styles | |
// import styles from './Styles/MyNewContainerStyle' |
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, { Component } from 'react' | |
import { Alert, ListView, BackHandler } from 'react-native' // add Alert and ListView | |
import { Container, Text, Header, Content, Form, Item, Input, Label, Button, Icon, Picker } from 'native-base'; | |
import { connect } from 'react-redux' | |
// Add Actions - replace 'Your' with whatever your reducer is called :) | |
// import YourActions from '../Redux/YourRedux' | |
// Styles | |
// import styles from './Styles/MyNewContainerStyle' |
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, { Component } from 'react' | |
import { Alert, ListView, BackHandler } from 'react-native' // add Alert and ListView | |
import { Content, Text } from 'native-base' | |
import { connect } from 'react-redux' | |
// Add Actions - replace 'Your' with whatever your reducer is called :) | |
// import YourActions from '../Redux/YourRedux' | |
// Styles | |
// import styles from './Styles/MyNewContainerStyle' |
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
'use strict'; | |
import React, {Component} from 'react'; | |
const styles = require('./Styles/styles.js') | |
import ReactNative from 'react-native'; | |
const { StyleSheet, Text, View} = ReactNative; | |
class StatusBar extends Component { | |
render() { | |
return ( | |
<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
import React, {Component} from 'react'; | |
const styles = require('./Styles/styles.js') | |
import ReactNative from 'react-native'; | |
const { View, TouchableHighlight, Text } = ReactNative; | |
class ListItem extends Component { | |
render() { | |
return ( | |
<TouchableHighlight onPress={this.props.onPress}> | |
<View style={styles.li}> |
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
const React = require('react-native') | |
const {StyleSheet} = React | |
const constants = { | |
actionColor: '#24CE84' | |
}; | |
var styles = StyleSheet.create({ | |
container: { | |
backgroundColor: '#f2f2f2', | |
flex: 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
# in app/controllers/family_controller.rb | |
# | |
# find out if there is prize remained to draw | |
prize_remained_count = 65 - Lotterywinner.where(:prize_id => 1).size if pid == 1 | |
prize_remained_count = 0 if pid == 2 | |
prize_remained_count = 0 if pid == 3 | |
prize_remained_count = 0 if pid == 4 | |
if @user.puzzlepieces.where(:puzzle_id => pid).map(&:position_number).uniq.size == 8 | |
if (cur<<position_number).uniq.size == 9 && prize_remained_count > 0 # important |
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
<div class="puzzle-history-container"> | |
<% @user_lotteries.each do |lottery| %> | |
<% @user_get_pieces = @user_pieces.where(:lottery_id => lottery.id) %> | |
<div class="puzzle-history-title"><%= lottery.serial_number %></div> | |
<!-- START of a puzzle row --> | |
<div class="puzzle-box-row"> |
NewerOlder