$ convert your.jpg -transparent white your.png
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sync() { | |
| var id="XXXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from | |
| var today=new Date(); | |
| var enddate=new Date(); | |
| enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time | |
| var secondaryCal=CalendarApp.getCalendarById(id); | |
| var secondaryEvents=secondaryCal.getEvents(today,enddate); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os | |
| import requests | |
| import itertools | |
| from dateutil.parser import parse | |
| API_KEY = '' | |
| API_SECRET = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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