Skip to content

Instantly share code, notes, and snippets.

View wlizama's full-sized avatar
💻
Making amazing things 🔣

Wilder Lizama wlizama

💻
Making amazing things 🔣
View GitHub Profile
@wlizama
wlizama / cookieModificar.js
Last active May 4, 2018 22:53
Modificar cookies
javascript:void prompt("Introduce la cookie:",document.cookie).replace(/[^;]+/g,function(_){document.cookie=_;});
// GLOBALS
//Array of file extension which you would like to extract to Drive
var fileTypesToExtract = ['pdf', 'xml'];
//Name of the folder in google drive i which files will be put
var folderName = 'LabelMOD';
//Name of the label which will be applied after processing the mail message
var labelName = 'LabelMOD';
git config --global alias.superlog "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(reset)%C(bold yellow)%d%C(reset)' --all"
from os import listdir
from os.path import isfile, join
MY_DIR = 'Q:\\midir'
def execute():
onlyfiles = [f for f in listdir(MY_DIR) if isfile(join(MY_DIR, f))]
print(onlyfiles)
import fnmatch
import os
MY_DIR = 'Q:\\my_dir\\sub_dir'
FILE_EXT = 'xml'
def filter_files_by_ext(dir, filter_ext):
files = [file for file in os.listdir(dir) if fnmatch.fnmatch(file, '*.%s' % filter_ext)]
return files
@wlizama
wlizama / never_commit_again.sh
Created July 23, 2019 14:06
No volver a considerar archivos o cambios que agregué a .gitignore
# Eliminamos cache de git
git rm -r --cached .
# Agregamos nuevamente archivos
git add .
@wlizama
wlizama / ascii_str.py
Created November 8, 2019 20:34
Crear una cadena ascii con los caracteres de otra
"".join([f"{ord(x):03}" for x in "Mysuperstring"])
@wlizama
wlizama / mount_drives.sh
Created February 27, 2020 22:56
montar unidades Linux
sudo mount.cifs //172.19.39.33/d$ /mnt/servers/33-D -o user=admin,pass='my_super_password'
@wlizama
wlizama / timeshift_install.sh
Created February 27, 2020 22:56
timeshift install
sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt update
sudo apt install timeshift
@wlizama
wlizama / useComponentWillMount.js
Created June 4, 2020 23:26
hook alternative to ComponentWillMount lifecycle method
import React, { useRef, useEffect } from 'react';
const useComponentWillMount = func => {
const willMount = useRef(true);
useEffect(() => {
willMount.current = false;
}, []);
if (willMount.current) { func(); }