Skip to content

Instantly share code, notes, and snippets.

View antoineclaval's full-sized avatar

antoine claval antoineclaval

  • Bakkt
  • New-Orleans, LA, USA
View GitHub Profile
#!usr/bin/env bash
find csvFolder/ -type f -name "*.csv" -exec sh -c 'f={}; sh convert.sh $f > $f.srt' \;
@antoineclaval
antoineclaval / convert.sh
Created November 19, 2022 19:46
srt generation from csv file
#!usr/bin/env bash
file=$1
i=1;
while IFS='@' read -r startTime endTime text; do
echo "\n$i"
startTimeF=$(echo $startTime | sed 's/./,/9')
endTimeF=$(echo $endTime | sed 's/./,/9')
@antoineclaval
antoineclaval / gist:03b3d6614f91e059067017ca7ce1d5a8
Created November 19, 2022 18:37
Bash string replace without sed / awk
string="abc"
final=${string//[a]/b}
echo $final
// "bbc"
@antoineclaval
antoineclaval / base64.sh
Created February 18, 2022 16:32
base64 encode/decode
#encode base64 string
echo -n 'some value to encode' | base64
#decode base64 string
echo -n 'someBase64 value' | base64 -D
@antoineclaval
antoineclaval / css-reset.css
Created January 8, 2022 06:05
2021 css reset ( J Comeau )
/*
1. Use a more-intuitive box-sizing model.
*/
*, *::before, *::after {
box-sizing: border-box;
}
/*
2. Remove default margin
*/
* {
add a much needed save all open file to gimp
@antoineclaval
antoineclaval / fix-homebrew-npm.md
Created April 21, 2020 22:19 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

READ THIS Very Important Update

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@antoineclaval
antoineclaval / mass-amend-commit.sh
Last active January 13, 2020 05:01
Mass Rewrite of existing commit, typically to switch users or email. ( filter-branch )
$ git filter-branch --env-filter '
WRONG_EMAIL="wrong@example.com"
NEW_NAME="New Name Value"
NEW_EMAIL="correct@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
set -a; source ~/my-project-dir/.env; set +a
python manage.py createsuperuser
docker exec -it “container-id” bash
docker-compose up -d --build
@antoineclaval
antoineclaval / postgres-brew.md
Created September 23, 2019 23:24 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update