var area= ( width, height ) => width * height;
If not, it is just clickbait for me. getPlayersByCountry= ( footballPlayers= [], players= {} ) ->
for player in footballPlayers
if players.hasOwnProperty player.country
players[ player.country ].push player
return players
playersByCountry= getPlayersByCountry footballPlayers, {France: [], England: [], Spain: []}
I guess it's mere a matter of taste. function logFsResult( type, err ){
var msg= '';
switch ( type ) {
case 'append': msg= ( err ) ? 'Failed to update file' : 'Successfully updated file';
break;
case 'write': msg= ( err ) ? 'Failed to write file' : 'Successfully created file';
break;
default: msg= 'logFsResult error, missing or invalid first argument: '+ (type || '')
}
( err ) ? console.err( msg ) : console.log( msg );
}
function handleFile( filename, fileExists ) {
const timestamp = new Date().toISOString();
( fileExists )
? fs.appendFile( filename, `Updated file on ${timestamp}\n`, logFsResult.bind(null, 'append') )
: fs.writeFile( filename, `Created file on ${timestamp}\n`, logFsResult.bind(null, 'write') );
} exists filename, (fileExists) -> handleFile filename, fileExists
Anything wrong with that line of code? function logAppendResult( err ) {
if (err) console.err('Failed to update file');
else console.log('Successfully updated file');
}
function logWriteResult( err ) {
if (err) console.err('Failed to create file');
else console.log('Successfully created file');
}
function handleFile( filename, fileExists ) {
const timestamp = new Date().toISOString();
( fileExists )
? fs.appendFile( filename, `Updated file on ${timestamp}\n`, logAppendResult )
: fs.writeFile( filename, `Created file on ${timestamp}\n`, logWriteResult );
}
function main() {
const filename = './example.txt';
exists( filename, (fileExists) => handleFile(filename, fileExists) );
}
There are too many good guides on the internet already, this one doesn't even come close providing all needed info. But I see the author has put his ether account address in the build string, that might be the main reason for this post.
Btw, don't go mining on linux with nvidia, it's really bad advice as overclocking all cards can take days to get it working if ever! Just use Windows for nvidia, it's a breeze to setup and you'll get overclocking for all cards out of the box.