Skip to content

Instantly share code, notes, and snippets.

@grimelda
grimelda / codecarbon_import_troubleshooting.ipynb
Last active July 20, 2021 11:34
codecarbon_import_troubleshooting.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@grimelda
grimelda / sigDigits.gs
Last active July 30, 2021 09:19
Custom google sheets apps script function to reduce value to N significant digits
/**
* @param {A1} value The value which should be reduced to n significant digits. E.g. 668951.12345
* @param {3} nDigits Number of significant digits in cell. Default 3.
* @return The value of a cell with N significant digits. E.g. 669000
* @customfunction
*/
function sigDigits(value, nDigits) {
var value = value || 668951.12345
var nDigits = nDigits || 3
valueRounded = +value.toFixed(0)
@grimelda
grimelda / convtomp4.sh
Last active January 28, 2023 17:01
single line command to use ffmpeg to convert all files with extension in (sub)folders to mp4
#! /bin/bash
find . -name "*.MOV" -exec ffmpeg -i "{}" -c:v libx265 -c:a aac -crf 14 -x265-params open-gop=0 "{}.mp4" \;
# add if remove original file:
# -exec rm "{}" \;