$ convert your.jpg -transparent white your.png
This file contains 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 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 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 |
This file contains 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 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 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 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
# How to downgrade helm version on server and client | |
# https://medium.com/@jyotirbhandari/how-to-downgrade-helm-version-on-server-and-client-4838ca100dbf | |
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash -s -- --version v2.16.9 |