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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$install_docker_script = <<SCRIPT | |
echo "Installing dependencies ..." | |
sudo apt-get update | |
echo Installing Docker... | |
curl -sSL https://get.docker.com/ | sh | |
sudo usermod -aG docker vagrant | |
SCRIPT |
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
package payment | |
import ( | |
"crypto/sha256" | |
"encoding/hex" | |
"net/http" | |
"sort" | |
"strings" | |
"time" | |
) |
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
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`), |
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
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 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 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 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 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 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 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' |
NewerOlder