Skip to content

Instantly share code, notes, and snippets.

@alexrecuenco
alexrecuenco / starship.toml
Created November 13, 2024 13:26
Starship with very little customization
# Get editor completions based on the config schema
# https://starship.rs/config/
# https://starship.rs/presets/
# https://starship.rs/presets/pastel-powerline
# https://www.nerdfonts.com/cheat-sheet
"$schema" = 'https://starship.rs/config-schema.json'
command_timeout = 300
format = "$all"
right_format = "$nodejs$python$time"
@alexrecuenco
alexrecuenco / generate_memorable_password.py
Last active September 4, 2023 23:00
Memorable passwords with python secrets
#!/usr/bin/env python
# Imitates a bit the functionality that used to exist on macos.
# This sketch returns a entropy estimate for the password.
from math import log2
import secrets
import string
import sys
from typing import Tuple
from warnings import warn
@alexrecuenco
alexrecuenco / convert.py
Last active March 29, 2023 22:50
Conver image files
# Requires `pip install Pillow`
# RUN
# python convert.py **/*.bmp
# It will overwrite any .jpg file
from PIL import Image
from pathlib import Path
import sys
import os
import logging
@alexrecuenco
alexrecuenco / bck.20181008131209.navigator.settings.json
Created September 19, 2022 14:08
Visual Studio Code Settings Sync Gist
{
"telemetry.enableTelemetry": false,
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"files.autoSave": "afterDelay",
"python.pythonPath": "/usr/local/bin/python3",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"editor.multiCursorModifier": "ctrlCmd",
@alexrecuenco
alexrecuenco / chromecast-volume.py
Last active December 16, 2023 23:19
Using PyChromecast to change the volume of a chrome cast device (Useful since VLC doesn't provide volume controls)
#!/usr/bin/env python3
# requirement: PyChromecast==12.1.4
# version 0.1
import pychromecast
import argparse
from typing import List, Union
import dataclasses
UP = "up"
DOWN = "down"
# If you are putting all sources from file,
```bash
ffmpeg -i file.m3u8 -codec copy output.mp4
```
# If you are downloading from a website you have to add the protocols it will be using
This list should work
```bash
@alexrecuenco
alexrecuenco / git-pushing-multiple.rst
Created February 29, 2020 05:01 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@alexrecuenco
alexrecuenco / remoteupdate.sh
Created February 23, 2020 16:33
Tool to update a given git remote to change origin to github, instead of whichever it was tracking before. (in union with github desktop)
#! /bin/bash -e
# Note that this will echo the commands you need to run, review them before running.
# It expects the process of
# 1. Remove all origins, echo commands to add them again (somewhere that is not origin)
# 2. You add in github desktop the repo and click the button to add github as the remote
# 3. Copy paste the commands that were echoed before to readd the other origins after your repo is tracking github
#### ---- ####
REMOTES=($(git remote))
@alexrecuenco
alexrecuenco / bck.20181008131209.navigator.settings.json
Created October 9, 2019 01:28
Visual Studio Code Settings Sync Gist
{
"telemetry.enableTelemetry": false,
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"files.autoSave": "afterDelay",
"python.pythonPath": "/usr/local/bin/python3",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"editor.multiCursorModifier": "ctrlCmd",
@alexrecuenco
alexrecuenco / multiple_ssh_setting.md
Created January 18, 2019 14:56 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"