Skip to content

Instantly share code, notes, and snippets.

View morav's full-sized avatar

Alexei morav

View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active July 24, 2024 12:43
Upload Files to Google Drive using Javascript

Upload Files to Google Drive using Javascript

News

At October 11, 2019, I published a Javascript library to to run the resumable upload for Google Drive. When this is used, the large file can be uploaded. You can also use this js library.

Description

This is a sample script for uploading files to Google Drive using Javascript. The files are uploaded by Drive API v3. gapi.client.drive.files.create() can create an empty file on Google Drive. But it cannot directly upload files including contents. I think that this might not be able to upload files and metadata with the multipart/related, although this might be resolved by the future update. So now, as one of workarounds, I use using XMLHttpRequest.

  • This sample uses gapi.
  • Before you use this, please enable Drive API at API console and carr
@dannguyen
dannguyen / README.md
Last active July 6, 2024 16:36
Using Python 3.x and Google Cloud Vision API to OCR scanned documents to extract structured data

Using Python 3 + Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

@csarigoz
csarigoz / mobile-desktop_speed-optimization.gs
Last active October 7, 2019 21:10
Googlesheet Script that returns Mobile Speed & Optimization and Desktop Speed & Optimization values in six adjacent columns
/**
* Returns Mobile Speed & Optimization and Desktop Speed & Optimization values in six adjacent columns
* by Cagri Sarigoz
*/
function checkAll(Url) {
//CHANGE YOUR API KEY WITH YOUR_API_KEY BELOW
var key = "YOUR_API_KEY";
var serviceUrlMobile = "https://www.googleapis.com/pagespeedonline/v4/runPagespeed?url=" + Url + "&strategy=mobile&key=" + key;
var serviceUrlDesktop = "https://www.googleapis.com/pagespeedonline/v4/runPagespeed?url=" + Url + "&strategy=desktop&key=" + key;
@Shoom
Shoom / gist:9622e6e09ca6be63f98f
Last active July 19, 2018 11:52
CSSconf EU 2014
{
"cssconf": {
"location": {
"date": "September 12, 2014",
"country": "Germany",
"city": "Berlin",
"venue": "Radialsystem V",
"lat": 52.51039,
"long": 13.42864
},
@nikcorg
nikcorg / berlin-jsconf-2014.md
Last active August 4, 2023 12:45
Slide decks of JSConf 2014
@bet4a
bet4a / README.md
Last active June 15, 2016 18:52
Chromebook Pixel Lightbar: Rainbow Flow

A gorgeous looping gradient for the Chromebook Pixel lightbar.

To use on your Dev Mode-enabled machine, copy this script, open a Chrome OS shell (Ctrl+Alt+T) and type shell. Right click to paste the code and press Enter; it'll start running after a second.