Skip to content

Instantly share code, notes, and snippets.

@melissachang
melissachang / gist:5a9c610a554e566a5f18e62c87329b7d
Last active December 30, 2023 18:52
In new Google Sites, embed spreadsheet without scrollbars
- In Google Sheet, Publish to Web. Select Embed. I only know how to hide scrollbar with Embed, not Link. Copy iframe html.
- In Google Site, insert Embed. Select Embed code. I only know how to hide scrollbar with Embed code, not By URL.
- Paste iframe html.
- To hide header/footer, change "widget=true&headers=false" to "widget=false&headers=false&chrome=false". See [1].
- Add iframe attributes: width=994 height=500 scrolling="no" frameBorder=0
- Can use Chrome Developer tools to measure width
- scrolling="no" hides scrollbars [2]
- frameBorder=0 hides iframe border
- Extend Google Sites blue box so you can see all of iframe.
@melissachang
melissachang / financial-data-2.json
Last active October 11, 2023 17:26
Data for backtesting investment portfolios (created by https://observablehq.com/d/78e5f7c4d459da40, firstYearOnPortfolioVisualizer=1986, lastYearOnPortfolioVisualizer = 2023, portfolioNumYears starts at 1)
[[1,[{"name":"High risk - no rebalance - 60 US / 30 Intl / 10 Bond","startYear":1986,"annualReturn":10.87,"inflationAdjustedAnnualReturn":6.16},{"name":"All stock - 100 US / 0 Intl / 0 Bond","startYear":1986,"annualReturn":2.61,"inflationAdjustedAnnualReturn":-1.74},{"name":"High risk - with rebalance - 60 US / 30 Intl / 10 Bond","startYear":1986,"annualReturn":10.87,"inflationAdjustedAnnualReturn":6.16},{"name":"Moderate risk - with rebalance - 40 US / 20 Intl / 40 Bond","startYear":1986,"annualReturn":7.76,"inflationAdjustedAnnualReturn":3.18},{"name":"High risk - no rebalance - 60 US / 30 Intl / 10 Bond","startYear":1987,"annualReturn":15.03,"inflationAdjustedAnnualReturn":10.15},{"name":"All stock - 100 US / 0 Intl / 0 Bond","startYear":1987,"annualReturn":9.72,"inflationAdjustedAnnualReturn":5.07},{"name":"High risk - with rebalance - 60 US / 30 Intl / 10 Bond","startYear":1987,"annualReturn":14.78,"inflationAdjustedAnnualReturn":9.91},{"name":"Moderate risk - with rebalance - 40 US / 20 Intl / 40 Bond",
@melissachang
melissachang / financial-data.json
Last active October 11, 2023 15:34
Data for backtesting investment portfolios (created by https://observablehq.com/d/78e5f7c4d459da40, firstYearOnPortfolioVisualizer=1972, lastYearOnPortfolioVisualizer = 2023, portfolioNumYears starts at 15)
[[15,[{"name":"High risk - no rebalance - 60 US / 30 Intl / 10 Bond","startYear":1972,"annualReturn":10.87,"inflationAdjustedAnnualReturn":6.16},{"name":"All stock - 100 US / 0 Intl / 0 Bond","startYear":1972,"annualReturn":2.61,"inflationAdjustedAnnualReturn":-1.74},{"name":"High risk - with rebalance - 60 US / 30 Intl / 10 Bond","startYear":1972,"annualReturn":10.87,"inflationAdjustedAnnualReturn":6.16},{"name":"Moderate risk - with rebalance - 40 US / 20 Intl / 40 Bond","startYear":1972,"annualReturn":7.76,"inflationAdjustedAnnualReturn":3.18},{"name":"High risk - no rebalance - 60 US / 30 Intl / 10 Bond","startYear":1973,"annualReturn":15.03,"inflationAdjustedAnnualReturn":10.15},{"name":"All stock - 100 US / 0 Intl / 0 Bond","startYear":1973,"annualReturn":9.72,"inflationAdjustedAnnualReturn":5.07},{"name":"High risk - with rebalance - 60 US / 30 Intl / 10 Bond","startYear":1973,"annualReturn":14.78,"inflationAdjustedAnnualReturn":9.91},{"name":"Moderate risk - with rebalance - 40 US / 20 Intl / 40 Bond"
@melissachang
melissachang / create-sidecar-images.sh
Last active April 22, 2024 17:23
Create sidecar images for videos, for storing metadata
#!/bin/bash
# Don't proceed if there are no files with a particular extension. https://stackoverflow.com/a/41139446
shopt -s nullglob
# Match MP4 in addition to mp4
shopt -s nocaseglob
for video_file in *.{mp4,mov} ; do
sidecar_file=$(echo $video_file | sed 's/\(.*\.\).*/\1jpg/' )
@melissachang
melissachang / gist:cf2e9d08248f6a1f13942dd480a9df78
Created May 17, 2018 23:27
.vimrc for automatically running yapf on a file on save
autocmd BufWritePre *.py 0,$!yapf
docker ps --format 'table{{.Names}}\t{{.ID}}' | tail -n +2
alias dp='docker ps --format "table{{.Names}}\t{{.ID}}" | tail -n +2'
container-name 800776c3abe0
another-container-name 460f70468172
last abf38e695c5a