Skip to content

Instantly share code, notes, and snippets.

View jerameel's full-sized avatar
:electron:

Jerameel Delos Reyes jerameel

:electron:
View GitHub Profile
@jerameel
jerameel / .bashrc
Last active March 8, 2023 17:15
Custom Bash Prompt with Git branch and Node version for NVM support.
parse_git_branch() {
OUT=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
if [ -n "$OUT" ]; then
echo $OUT
else
echo 'N/A'
fi
}
parse_node_version(){
@jerameel
jerameel / bulb_client_monitor.py
Last active January 10, 2021 14:18
A python script to automatically control yeelight bulb when a target device (mobile phone for example) is connected on a specific network. For example, Brighten/Dim light when user enters/leaves the proximity.
#!/usr/bin/env python3.7
import os
from datetime import datetime,timedelta
from yeelight import Bulb,Flow,BulbException
from yeelight.flows import night_mode
# MAC Address target devices
TARGET_DEVICES = [
'00:00:00:00:00:00',
@jerameel
jerameel / backup_ipcam.py
Last active December 21, 2020 08:58
A python script to automatically backup Yi Hack camera into an FTP server.
#!/usr/bin/env python3.7
import sys
import time
from datetime import datetime,timedelta
from ftplib import FTP
from urllib.request import urlretrieve
DEBUG = True
FTP_HOST = "192.168.X.X"
FTP_DEFAULT_FOLDER = 'Data'