Engine ne change pas d'interface et on code un http API par dessus.
- Rapide à coder
- break rien pentoute
Alberto is an aviation pioneer. He pilots an airplane called "14-bis". Initially, there are F units of fuel in the fuel tank of his airplane.
There are some flight missions Alberto may take. The missions all start and end in the same location, and he may do them in any order. However, he can only do each mission at most once. You are given two int[]s of the same length: duration and refuel. For each valid i:
Alberto can only choose a mission if he has enough fuel for it. That is, at the beginning of the mission his fuel tank must have at least duration[i] units of fuel.
'use strict'; | |
import fetch from 'node-fetch'; | |
import DexeroHttpError from '../../error'; | |
export default class DonationService { | |
getBase64EncodedDexeroCredentials() { | |
this.clientId = process.env.DEXERO_CLIENT_ID; | |
this.clientSecret = process.env.DEXERO_CLIENT_SECRET; | |
return new Buffer(`${this.clientId}:${this.clientSecret}`).toString('base64'); |
[10:36:29] eff_it:~ $ phantomas http://www.manta.com --verbose | |
15:40:19.776 phantomas v1.14.0: /usr/local/lib/node_modules/phantomas/ | |
15:40:19.776 Options: {"format":"plain","R":"plain","reporter":"plain","timeout":15,"silent":false,"progress":false,"page-source":false,"film-strip":false,"colors":false,"analyze-css":false,"stop-at-onload":false,"spy-eval":false,"scroll":false,"no-externals":false,"disable-js":false,"v":true,"verbose":true,"h":false,"help":false,"V":false,"version":false,"url":"http://www.manta.com","user-agent":"phantomas/1.14.0 (PhantomJS/2.1.1; darwin x64)"} | |
15:40:19.779 Loading: core modules... | |
15:40:19.781 Core module navigationTiming v1.0 initialized | |
15:40:19.791 Core module requestsMonitor v1.2 initialized | |
15:40:19.792 Core module timeToFirstByte v1.1 initialized | |
15:40:19.792 Loading: extensions... | |
15:40:19.792 Getting the list of all modules in /usr/local/lib/node_modules/phantomas/extensions... | |
15:40:19.795 Module cookies v1.0 initialized |
#from date to js timestamp | |
from datetime import datetime | |
from calendar import timegm | |
python_date = datetime.now() | |
js_timestamp = timegm(python_date.timetuple()) * 1000 |