Skip to content

Instantly share code, notes, and snippets.

View psbarrales's full-sized avatar
💻

Pablo Barrales psbarrales

💻
View GitHub Profile
@psbarrales
psbarrales / stable_diffusion.py
Last active November 6, 2022 16:08
Snippets para el articulo de Medium
from diffusers import StableDiffusionPipeline
token = "TU_TOKEN" # Acá va el token copiado desde Hugging Face
model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=token)
## Si tienes tarjeta gráfica
# device = "cuda"
# pipe = pipe.to(device)
@psbarrales
psbarrales / profile.sh
Created January 3, 2022 18:15
Bash function to do a change directory and apply .env file
#!/bin/bash
dev() {
[[ ! -z "$1" ]] && cd $1 && set -a
source .env
set +a
}
/*====================================================================================================================================*
ImportJSON by Brad Jasper and Trevor Lohrbeer
====================================================================================================================================
Version: 1.5.0
Project Page: https://github.com/bradjasper/ImportJSON
Copyright: (c) 2017-2019 by Brad Jasper
(c) 2012-2017 by Trevor Lohrbeer
License: GNU General Public License, version 3 (GPL-3.0)
http://www.opensource.org/licenses/gpl-3.0.html
------------------------------------------------------------------------------------------------------------------------------------
@psbarrales
psbarrales / README.md
Last active November 2, 2020 20:01
Static Password Generator

Static Password Generator

This simple snippet generates a static and secure password for your services, so you simply run the command and you will get the same password, you just have to remember the service (twitter, github, apple, etc), the version and the length.

Instalation

npm i
npm link
Try to passgen facebook or passgen twitter

Usage

passgen [service] [-v version] [-l length]

Keybase proof

I hereby claim:

  • I am psbarrales on github.
  • I am psbarrales (https://keybase.io/psbarrales) on keybase.
  • I have a public key ASAAEn1Uwfzacu9YUyjyXS2870In7nHBjDxtCuu-zQGL_Ao

To claim this, I am signing this object:

@psbarrales
psbarrales / restart_bluetooth.sh
Created June 28, 2017 02:46 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@psbarrales
psbarrales / psbarrales.zsh-theme
Last active October 17, 2017 14:27
Theme zsh agnoster form
# vim:ft=zsh ts=2 sw=2 sts=2
#
# psbarrales's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
# AGNOSTER FORK
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline