Skip to content

Instantly share code, notes, and snippets.

Francois-Xavier P. Darveau EFF

Block or report user

Report or block EFF

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Alberto the Aviator, taken from topcoder

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:

  • duration[i] is the amount of fuel consumed while running mission i
  • After Alberto completes mission i and gets paid, he will buy refuel[i] units of fuel. This amount will always be strictly smaller than the amount consumed during the mission.

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.

View donation-service.js
'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');
EFF / results.txt
Created Feb 3, 2016 verbose phantomas run
View results.txt
[10:36:29] eff_it:~ $ phantomas --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":"","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
EFF / from python date to js utc timestamp
Created May 28, 2015
python date conversion with js utc timestamp
View from python date to js utc timestamp
#from date to js timestamp
from datetime import datetime
from calendar import timegm
python_date =
js_timestamp = timegm(python_date.timetuple()) * 1000
You can’t perform that action at this time.