Skip to content

Instantly share code, notes, and snippets.

View ricglz's full-sized avatar
:octocat:
On github

Ricardo J Gonzalez ricglz

:octocat:
On github
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Inspired from https://github.com/oriolbernal/face-swap/blob/master/face_swap.py
"""
from typing import Tuple
import cv2
import numpy as np
@ricglz
ricglz / snippet.zsh
Created September 15, 2020 20:56
Delete git repos folders (using fd)
# Using fd (https://github.com/sharkdp/fd)
# How it works?
# 1. fd -H '\.git$' finds the git folders inside the repos
# 2. -x "rm -rf '{//}'" executes the operation of deleting the folder
# 3. '{//}' is to say that the folder it should remove is the parent folder
# of the result, which in this case is the folder of the repo
fd -H '\.git$' -x "rm -rf '{//}'"
@ricglz
ricglz / color_scheme.vim
Last active May 15, 2020 20:48
Vim files for Ukko Talk
highlight stlModified ctermfg=167 guifg=#d84a44 ctermbg=235 guibg=#282828 cterm=bold gui=bold
highlight stlTypeInfo ctermfg=73 guifg=#6fa3a6 ctermbg=235 guibg=#282828 cterm=NONE gui=NONE
highlight stlDirInfo ctermfg=116 guifg=#84d4d2 ctermbg=237 guibg=#3c3836 cterm=NONE gui=NONE
highlight stlErrorInfo ctermfg=167 guifg=#d84a44 ctermbg=235 guibg=#282828 cterm=NONE gui=NONE
highlight stlNormalMode ctermfg=172 guifg=#d79921 ctermbg=239 guibg=#504945 cterm=bold gui=bold
highlight stlInsertMode ctermfg=234 guifg=#1d2021 ctermbg=65 guibg=#679a69 cterm=bold gui=bold
highlight stlVisualMode ctermfg=234 guifg=#1d2021 ctermbg=173 guibg=#c7743e cterm=NONE gui=NONE
highlight stlReplaceMode ctermfg=234 guifg=#1d2021 ctermbg=73 guibg=#6fa3a6 cterm=NONE gui=NONE
highlight stlSelectMode ctermfg=234 guifg=#1d2021 ctermbg=73 guibg=#6fa3a6 cterm=NONE gui=NONE
@ricglz
ricglz / update_images.py
Created April 7, 2020 03:24
Update images timestamp when its name includes the format "%Y%m%d %H%M%S"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from time import mktime
from glob import glob
from os import utime
from re import findall
@ricglz
ricglz / update_images_script.py
Created April 7, 2020 02:47
Update datetime of images downloaded from FB, when you ask them for a copy of your messages.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from json import load
from glob import glob
from os import utime
def update_multimedia(multimedias):
for multimedia in multimedias: