This file contains hidden or 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 { | |
| StyleSheet, | |
| Text, | |
| TouchableOpacity, | |
| FlatList, | |
| View | |
| } from 'react-native' | |
| export default class TaskListScreen extends Component { |
This file contains hidden or 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 { observable, action } from 'mobx' | |
| class TaskListStore { | |
| @observable list = [ | |
| { title: 'Go to the office', isFinished: true }, | |
| { title: 'Prepare tasks for today', isFinished: false }, | |
| { title: 'Team meeting', isFinished: false }, | |
| { title: 'Commit tasks changed', isFinished: false } | |
| ] |
This file contains hidden or 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 { | |
| StyleSheet, | |
| Text, | |
| TouchableOpacity, | |
| FlatList, | |
| View | |
| } from 'react-native' | |
| import taskListStore from './../mobx/TaskListStore' |
This file contains hidden or 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
| // ES6 | |
| // A normal object | |
| class iPhoneX { | |
| secretName = 'iPhoneX' | |
| constructor(price) { | |
| this.price = price | |
| } | |
| setPrice = (value) => { |
This file contains hidden or 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
| /** | |
| * This program merges all images in "./input" folder to "/output" folder horizontally | |
| * Ex: ./input/1.jpg + ./input/2.jpg => ./output/12.jpg | |
| **/ | |
| package main | |
| import ( | |
| "fmt" |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| ) | |
| func handler(w http.ResponseWriter, r *http.Request) { | |
| w.Header().Set("Content-Type", "text/html; charset=utf-8") | |
| fmt.Fprint(w, "<center><h1>Welcome to my page<h1></center>") |
This file contains hidden or 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 golang:latest | |
| RUN mkdir /app | |
| ADD . /app/ | |
| WORKDIR /app | |
| RUN go build -o demoApp . | |
| CMD ["/app/demoApp"] |
This file contains hidden or 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 golang:latest as builder | |
| RUN mkdir /app | |
| ADD . /app/ | |
| WORKDIR /app | |
| RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o demoApp . | |
| FROM alpine:latest | |
| WORKDIR /app/ | |
| COPY --from=builder /app . | |
| CMD ["/app/demoApp"] |
This file contains hidden or 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
| CREATE TABLE `restaurants` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `owner_id` int(11) NULL, | |
| `name` varchar(50) NOT NULL, | |
| `addr` varchar(255) NOT NULL, | |
| `city_id` int(11) DEFAULT NULL, | |
| `lat` double DEFAULT NULL, | |
| `lng` double DEFAULT NULL, | |
| `cover` json NULL, | |
| `logo` json NULL, |
This file contains hidden or 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
| DROP TABLE IF EXISTS `carts`; | |
| CREATE TABLE `carts` ( | |
| `user_id` int NOT NULL, | |
| `food_id` int NOT NULL, | |
| `quantity` int NOT NULL, | |
| `status` int NOT NULL DEFAULT '1', | |
| `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, | |
| `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| PRIMARY KEY (`user_id`,`food_id`), |
OlderNewer