This file contains hidden or 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
// console.log("Hello, World!"); | |
var calPoints = function(ops) { | |
result = null; | |
output = []; | |
checks = true; | |
// check constraints | |
// check if operations length constraints is met | |
if(!(ops.length >= 1 || ops.length <= 1000)) |
This file contains hidden or 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
require __DIR__ . '/google-api-php-client/src/Google/autoload.php'; | |
define('APPLICATION_NAME', 'Drive API PHP Quickstart'); | |
define('CREDENTIALS_PATH', __DIR__.'/drive-php-quickstart.json'); | |
define('CLIENT_SECRET_PATH', __DIR__ . '/client_secret.json'); | |
define('SCOPES', implode(' ', array( | |
Google_Service_Drive::DRIVE) | |
)); | |
if (php_sapi_name() != 'cli') { |
This file contains hidden or 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
// A few settings | |
$image = 'cricci.jpg'; | |
// Read image path, convert to base64 encoding | |
$imageData = base64_encode(file_get_contents($image)); | |
// Format the image SRC: data:{mime};base64,{data}; | |
$src = 'data: '.mime_content_type($image).';base64,'.$imageData; | |
// Echo out a sample image |