Skip to content

Instantly share code, notes, and snippets.

@otroboe
otroboe / download.js
Created April 25, 2023 21:20
Frontend - Download a file from an endpoint
export const downloadFile = async (
urlPath: string,
locale: string,
fileName: string,
): Promise<void> => {
const request = new Request(`${baseUrl}/${urlPath}`, {
method: 'GET',
headers: new Headers({
'Accept-Language': locale,
Authorization: `Bearer ${localStorage.getItem('accessToken')}`,
@otroboe
otroboe / .bash_gitbranch
Last active February 13, 2023 21:06
Show the current git branch in command line.
#!/bin/bash
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
## Mac iTerm2
## https://dev.to/ahmettkartal/display-current-git-branch-on-iterm2-3ko8
@otroboe
otroboe / .bash_aliases
Last active May 31, 2022 19:41
Aliases I use most of the time
#!/bin/bash
alias l="ls -la"
alias dl="docker ps -a"
alias dp="docker system prune"
alias di="docker images -a"
alias dcu="docker-compose up -d"
alias dcp="docker-compose ps"
alias dcd="docker-compose down"
@otroboe
otroboe / montreal-cinema-locations.json
Last active February 16, 2018 17:02
Montreal list of cinema locations
[{
"name": "Banque Scotia Montréal",
"address": "977 rue Ste-Catherine O. (Metcalfe), Montréal",
"phone": "(514) 842-0549",
"latitude": 45.501021,
"longitude": -73.572194
}, {
"name": "Beaubien",
"address": "2396 rue Beaubien Est (d'Iberville), Montréal",
"phone": "(514) 721-6060",