- https://developers.google.com/apps-script/guides/clasp
- https://github.com/google/clasp#run
- https://raw.githubusercontent.com/google/clasp/master/docs/run.md
- Get up to speed with Google Clasp - Video
- https://medium.com/@efrem.sternbach/how-i-published-a-google-sheets-add-on-or-wtf-google-483a66833d70
- https://developers.google.com/apps-script/concepts/manifests
- https://developers.google.com/apps-script/manifest
- https://hawksey.info/blog/2017/11/everything-you-always-wanted-to-know-about-google-apps-script-manifest-files-but-were-afraid-to-ask/#gref
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
| /* A bare-bones GithubClient, just used for commits */ | |
| function GithubClient(owner, repo, username, passwordOrToken) { | |
| this.owner = owner; | |
| this.repo = repo; | |
| this.username = username; | |
| this.passwordOrToken = passwordOrToken; | |
| } | |
| /* |
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
| # To get a list of Chrome profiles in JSON format use this URL in your Chrome browser: | |
| # chrome://local-state/ | |
| # Save the content to local-state.json and then: | |
| cat local-state.json| jq '.profile.info_cache | to_entries | .[] | [{person:.value.gaia_given_name, label:.value.name, email:.value.user_name, profile:.key}]' | |
| cat local-state.json| jq '.profile.info_cache | to_entries | .[] | select(.value.user_name=="aculich@berkeley.edu") | [{person:.value.gaia_given_name, label:.value.name, email:.value.user_name, profile:.key}]' | |
| # jq-cheetsheet.md | |
| # https://gist.github.com/olih/f7437fb6962fb3ee9fe95bda8d2c8fa4 |
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 |
Get latest release from github repo: https://github.com/adobe-fonts/source-code-pro
This assumes you have the gh github package installed. Either for Ubuntu snap install gh or OSX: brew install gh
$ gh release view -R adobe-fonts/source-code-pro --jq '.assets[].url' --json assets | grep TF
https://github.com/adobe-fonts/source-code-pro/releases/download/2.038R-ro/1.058R-it/1.018R-VAR/OTF-source-code-pro-2.038R-ro-1.058R-it.zip
https://github.com/adobe-fonts/source-code-pro/releases/download/2.038R-ro/1.058R-it/1.018R-VAR/TTF-source-code-pro-2.038R-ro-1.058R-it.zip
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
| # brew install hub jq | |
| ### Create a list of github usernames in a file and then: | |
| for i in `cat curriculum-development`; do hub api --flat orgs/dlab-berkeley/teams/curriculum-development/memberships/$i -X PUT; done | |
| ### see docs in: https://docs.github.com/en/rest/reference/teams#add-or-update-team-membership-for-a-user |