Skip to content

Instantly share code, notes, and snippets.

View stoufa's full-sized avatar

Stoufa stoufa

View GitHub Profile
@stoufa
stoufa / tmp_chrome.sh
Created September 28, 2023 10:51
Open Google Chrome with Temporary Profile (Tested on Ubuntu 23.04)
#!/usr/bin/env bash
# a better alternative to incognito mode! (you can re-open tabs closed by mistake! 😉)
# this profile will be wiped out when you log off
# (ℹ️) make sure to turn sync on to access your extensions and bookmarks
google-chrome --user-data-dir=/tmp/chrome-temp-profile
@stoufa
stoufa / sum_youtube_videos_durations.js
Last active August 25, 2023 09:57
compute the sum of a YouTube videos playlist
// a JS script to compute the sum of a YouTube videos playlist
function unify_format(duration) {
// sum_durations assumes the format 'h:m:s' which is not the case for videos less than an hour
// this function will append missing values to fit into the expected format.
// count number of ':' in duration
const count = duration.split(":").length - 1;
if (count == 0) // e.g. '27'
return `0:0:${duration}`;
if (count == 1) // e.g. '2:27'
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew cask install iterm2
# update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts
brew install bash # latest version of bash
# set brew bash as default shell
brew install fortune
brew install cowsay
brew install git