Let's make sure our Express app has the required base modules:
# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
/* ProtonMail */ | |
/* CLASSIC THEME */ | |
body { font-size: 14px } | |
body, | |
.pm_opensans { | |
font-family: 'Lucida Grande', Verdana, Arial, sans-serif | |
} |
export const fetchAsBlob = url => fetch(url) | |
.then(response => response.blob()); | |
export const convertBlobToBase64 = blob => new Promise((resolve, reject) => { | |
const reader = new FileReader; | |
reader.onerror = reject; | |
reader.onload = () => { | |
resolve(reader.result); | |
}; | |
reader.readAsDataURL(blob); |
/* global gapi */ | |
const API_KEY = 'YOURAPIKEYHERE'; | |
import React, { Component } from 'react'; | |
class App extends Component { | |
loadYoutubeApi() { | |
const script = document.createElement("script"); |
/* Required: http://www.fontsquirrel.com/fonts/open-sans */ | |
@-moz-document domain("youtube.com") | |
{ | |
:root | |
{ | |
--bg: #1d1e2a !important; | |
/* main */ | |
--bg2: #1a1b26 !important; | |
/* alt */ | |
--bg3: #14151F !important; |
SPC | |
SPC: find file | |
, switch buffer | |
. browse files | |
: MX | |
; EX | |
< switch buffer | |
` eval | |
u universal arg | |
x pop up scratch |
drawImage = async img_path => { | |
let canvas = document.createElement("canvas"); | |
canvas.src = img_path; | |
const context = canvas.getContext("2d"); | |
const img = await loadImage(img_path); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
context.drawImage(img, 0, 0); |
This is a simple sample script for achieving the resumable upload to Google Drive using Node.js. In order to achieve the resumable upload, at first, it is required to retrieve the location, which is the endpoint of upload. The location is included in the response headers. After the location was retrieved, the file can be uploaded to the location URL.
In this sample, a PNG file is uploaded with the resumable upload using a single chunk.
Before you use this, please set the variables.
"workbench.colorCustomizations": { | |
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast. | |
"contrastActiveBorder": "", | |
"contrastBorder": "", | |
// Base Colors | |
"focusBorder": "", | |
"foreground": "", | |
"widget.shadow": "", | |
"selection.background": "", | |
"descriptionForeground": "", |