Skip to content

Instantly share code, notes, and snippets.

View aculich's full-sized avatar
😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG

Aaron Culich aculich

😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG
View GitHub Profile

Remove white background color of an image in ImageMagick

$ convert  your.jpg  -transparent white  your.png

Flatten a transparent image with a white background:

@aculich
aculich / sort-tabs.txt
Created July 27, 2021 02:15 — forked from bpmore/sort-tabs.txt
Sort Tabs in Google Spreadsheets
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 () {
@aculich
aculich / walk_gdrive.py
Created July 9, 2021 15:23 — forked from xflr6/walk_gdrive.py
Recursively traverse the directory tree of a Google Drive folder as variation of os.walk()
# 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
@aculich
aculich / spacemacs-install-source-code-pro-font.md
Last active July 4, 2021 02:03
download and install source code pro font for spacemacs

Install Adobe Source Code Pro fonts for Spacemacs

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
@aculich
aculich / add-dlab-team-members.sh
Created June 23, 2021 01:10
Add D-Lab Team members
# 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
@aculich
aculich / server.py
Created June 16, 2021 12:50 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/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):
@aculich
aculich / web-servers.md
Created June 16, 2021 12:50 — forked from willurd/web-servers.md
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@aculich
aculich / dummy-web-server.py
Created June 16, 2021 12:47 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/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:
@aculich
aculich / zdl.py
Created March 29, 2021 17:48 — forked from danaspiegel/zdl.py
Zoom Recording Downloader
#!/usr/bin/env python3
import os
import requests
import itertools
from dateutil.parser import parse
API_KEY = ''
API_SECRET = ''
@aculich
aculich / *scratch*.txt
Last active August 25, 2022 01:54
Downgrade helm client
# 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