This is a example on how to return a utf-8 encoded csv form a django view.
import csv
import codecs
from django.contrib.auth import get_user_model
from django.views import View
#! /usr/bin/env hy | |
(import [bottle [route run template]]) | |
(with-decorator (route "/hello/<name>") | |
(defn index [name] | |
(template "<b>Hello {{name}}</b>!" :name name))) | |
(run :host "localhost" :port 8080) |
/* | |
This is a example serverless.js handler where we pass the | |
document we want to analyze as a base64 string (in a json payload) | |
and returns the result from textract. | |
Request: | |
{ | |
"document": "/9j/4AAQS......." | |
} | |
""" | |
Installation: | |
pip install coconut | |
pip install bottle | |
pip install peewee | |
Running: | |
coconut test.coco && python test.py | |
""" |
The api documentation for Google Spreadsheets is good and all, but is missing some straightforward usage examples, so here is one I could not find, how to take a plain multidimensional array with a header and write everything to a spreadsheet, replacing the old content.
const SPREADSHEET_ID = "ABC123";
const auth = new google.auth.OAuth2(
client_id,
client_secret,
redirect_uris[0],
import re | |
def snake_case_to_camel_case(val): | |
return converter(val, snake_case_to_camel_case, snake_to_camel) | |
def camel_case_to_snake_case(val): | |
return converter(val, camel_case_to_snake_case, camel_to_snake) |