Skip to content

Instantly share code, notes, and snippets.

View scansio's full-sized avatar
😀
I am always available

Emmanuel Elom scansio

😀
I am always available
View GitHub Profile
@SackeyDavid
SackeyDavid / gist:11701048859f47b7b98fbcc69631a033
Created September 19, 2021 01:51
Turing Coding Challenge Practise Test
// 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))
@vielhuber
vielhuber / api.php
Last active November 24, 2022 12:50
Google Drive API v3 Helper library #php
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') {
@hengkiardo
hengkiardo / gist:4023855
Created November 6, 2012 10:13
Create image data URIs (base64) using PHP
// 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