Skip to content

Instantly share code, notes, and snippets.

View thanhtungdp's full-sized avatar
🎯
Focusing

Phan Thanh Tùng thanhtungdp

🎯
Focusing
View GitHub Profile
@thanhtungdp
thanhtungdp / custom.js
Created November 26, 2020 13:27
custom.js
console.log("good from gist")
@thanhtungdp
thanhtungdp / cloudSettings
Created May 13, 2020 03:01 — forked from dtanphat9388/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-13T02:04:23.246Z","extensionVersion":"v3.4.3"}
@thanhtungdp
thanhtungdp / upload.js
Created April 3, 2020 02:20
Upload Photo to Minio
const currentPrefix = "Giới thiệu/" //current folder
const fileName = "tung.jpg"
const prefix = path.join(currentPrefix, fileName)
const { data: { url }} = await api.get(`/s3/buckets/ilotusland/presigned-put-object?prefix=${prefix}`)
// `url` là API trả về, để từ Frontend PUT lên dữ liệu
const file = Object{} // file from select
client.processTrip({
idTrip: 'trip_id_' + Math.floor(Date.now() / 1000).toString(),
idDriver: 'id_driver_' + Math.floor(Date.now() / 1000).toString(),
idGuess: 'id_guess_' + Math.floor(Date.now() / 1000).toString(),
amount: 15000,
balanceType: 1,
appMode: 'dev',
platform: 'IOS'
}, (error, response) => {
if (!error) {
client.processTrip({
idTrip: 'trip_id_' + Math.floor(Date.now() / 1000).toString(),
idDriver: 'id_driver_' + Math.floor(Date.now() / 1000).toString(),
idGuess: 'id_guess_' + Math.floor(Date.now() / 1000).toString(),
amount: 15000,
balanceType: 1,
appMode: 'dev',
platform: 'IOS'
}, (error, response) => {
if (!error) {
import mongoose from "mongoose";
var { Schema } = mongoose;
var HistoryActionSchema = new Schema({
userId: String,// driver id
tripId: {
type: String,
unique: true,
required: true,
import mongoose from "mongoose";
var { Schema } = mongoose;
var PaymentOrderSchema = new Schema({
debitAccount: String,// driver id
creditAccountId: String, // guess id
balanceType: Number,
tripId: {
type: String,
@thanhtungdp
thanhtungdp / billingLog.js
Created January 2, 2020 18:20
billingLog.js
import mongoose from "mongoose";
var { Schema } = mongoose;
var BillingLogSchema = new Schema({
sourceId: String,
destId: String,
debitMoney: {
type: Number,
default: 0
@thanhtungdp
thanhtungdp / createLang.js
Created January 15, 2018 02:14
Language
// hoc/create-lang.js
/*eslint-disable*/
import React from 'react'
import PropTypes from 'prop-types'
import objectPath from 'object-path'
import { connectAutoDispatch } from 'redux/connect'
import { changeLanguage } from 'redux/actions/languageAction'
import { autobind } from 'core-decorators'
import dot from 'dot'
@thanhtungdp
thanhtungdp / color.js
Created January 14, 2018 05:17
theme/color.js
import color from 'color'
export const SHAPE = {
RED: '#EB5C55',
ORANGE: '#F6A623',
PURPLE: '#A076C5',
BLACK: '#3B3B3B',
GREEN: '#2ECC71',
PRIMARY: '#389BFF',
PRIMARYBOLD: '#007EE5',