⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
from PIL import Image, ImageDraw | |
import argparse | |
import sys | |
def get_colors(image_file, numcolors=10, resize=150): | |
# Resize image to speed up processing | |
img = Image.open(image_file) | |
img = img.copy() | |
img.thumbnail((resize, resize)) |
It is easy to get service accounts working with App Engine's app_devserver.py
- once you know how.
On the way there, you might have pulled out all your hair following one documentation dead end after another, trying to piece together the right information.
Here are the steps you need to take, in exact order, to get this working. Once you follow these steps, you'll be able to use service accounts in local development, so that you can interact with Google APIs (e.g.: Spreadsheet, Calendar) in a way that is consistent with the deployment environment on App Engine.
In order to follow the instructions, you'll be better off using the latest UI for Google Cloud projects. Older interfaces (such as the dedicated App Engine dashboard) have things in different places, under different names, etc. It is a world of pain there.
Also note that I've tested this on several 1.9.x releases of App Engine; I can't confirm the behaviour of earlier releases.
var cleanUp = function() { | |
$.ajax({method: "GET", url: "https://prerender.io/api/cached-pages?page=0&pageSize=1000000"}).success(function(response) { | |
var total = response, | |
lastChecked = 1; | |
console.log("total: " + response.length); | |
for(var i = 0; i < total.length; i++) { | |
$.ajax({ | |
method: "DELETE", |
let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () { | |
try { | |
return Boolean(new Blob()); | |
} catch (e) { | |
return false; | |
} | |
}()); | |
let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () { | |
try { |
export CHROME_BIN=/usr/bin/google-chrome | |
export DISPLAY=:99.0 | |
sh -e /etc/init.d/xvfb start | |
sudo apt-get update | |
sudo apt-get install -y libappindicator1 fonts-liberation | |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
sudo dpkg -i google-chrome*.deb |