Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
1. Copy/Paste the information below to the clipboard | |
2. Open the spreadsheet whose sheets need to be alphabetised | |
3. Choose Tools > Script editor > Blank (this opens a new tab in the browser) | |
4. Press Control+A followed by Control+V copy and paste the script in | |
5. Press Control+S to save the script | |
6. Choose Run > sortSheets | |
7. Go back to the spreadsheet tab to view the new sorted tab order | |
--Copy everything below this line-- | |
function sortSheets () { |
# walk_gdrive.py - os.walk variation with Google Drive API | |
import os | |
from apiclient.discovery import build # pip install google-api-python-client | |
FOLDER = 'application/vnd.google-apps.folder' | |
def get_credentials(scopes, secrets='~/client_secrets.json', storage='~/storage.json'): | |
from oauth2client import file, client, tools |
#!/usr/bin/env python3 | |
""" | |
Very simple HTTP server in python for logging requests | |
Usage:: | |
./server.py [<port>] | |
""" | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import logging | |
class S(BaseHTTPRequestHandler): |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/usr/bin/env python | |
""" | |
Very simple HTTP server in python (Updated for Python 3.7) | |
Usage: | |
./dummy-web-server.py -h | |
./dummy-web-server.py -l localhost -p 8000 | |
Send a GET request: |
#!/usr/bin/env python3 | |
import os | |
import requests | |
import itertools | |
from dateutil.parser import parse | |
API_KEY = '' | |
API_SECRET = '' |
""" | |
Mostly the Google quickstart.py code with the "freebusy" service running. | |
Also shows how to make datetimes using pytz. | |
Follow these instructions to get access credentials: | |
https://developers.google.com/google-apps/calendar/quickstart/python | |
""" |
=IF(ISTEXT('Sheet1'!A1), "*", IF(ISBLANK('Sheet1'!A1),'Sheet1'!A1, IF('Sheet1'!A1 >= 10, IMAGE("https://docs.google.com/drawings/d/1zvwx-srTZlBYQgO1KNdx9-aB1Bw-GRXCfByBPmW0X_M/pub?w=120&h=90"), IF(AND('Sheet1'!A1 < 10,'Sheet1'!A1 >= 7.5), IMAGE("https://docs.google.com/drawings/d/1YlsedUl2v81KzJjGrmDu90f7Kvc-C4sMQ_EnM40Eei4/pub?w=120&h=90"), IF(AND('Sheet1'!A1 < 7.5,'Sheet1'!A1 >= 5), IMAGE("https://docs.google.com/drawings/d/1IFZiKmFa8zv_7XYxBkIrbJOb_QthS5aNP_VPs3sPbx4/pub?w=120&h=90"), IF(AND('Sheet1'!A1 < 5, 'Sheet1'!A1 >= 2.5),IMAGE("https://docs.google.com/drawings/d/1P0ZZ6bbx1xnhaIDKU34XY_rGzfZIcDbN-dycneMlZ1k/pub?w=120&h=90"),IF('Sheet1'!A1 < 2.5,IMAGE("https://docs.google.com/drawings/d/1gTEKIQuY29SB1HCrcDiT31D0ZsaWaUVMBW_ZW5sjGow/pub?w=120&h=90"),'Sheet1'!A1)))))))
NOTE: "Sheet1" should be replaced with whatever the target sheet name actually is in your Google Sheets document
// OUTDATED | |
// See the current version here: | |
// github.com/b0o/surfingkeys-conf | |
// Unmap undesired defaults | |
var unmaps = [ "sb" , "sw", "ob" | |
, "ow" , "cp", ";cp" | |
, ";ap", "spa", "spb" | |
, "spd", "sps", "spc" | |
, "spi", "sfr", "zQ" |
// OUTDATED | |
// See the current version here: | |
// github.com/b0o/surfingkeys-conf | |
// Unmap undesired defaults | |
var unmaps = [ "sb" , "sw", "ob" | |
, "ow" , "cp", ";cp" | |
, ";ap", "spa", "spb" | |
, "spd", "sps", "spc" | |
, "spi", "sfr", "zQ" |