Skip to content

Instantly share code, notes, and snippets.

View wesbluemarine's full-sized avatar

Alberto wesbluemarine

View GitHub Profile
blueprint:
name: Energy Disaggregation
description: Approximate power usage of an appliance
domain: automation
input:
power_helper:
name: Input helper to store the approximate power usage
description: in W
selector:
entity:
@tronikos
tronikos / energy_disaggregation.yaml
Last active March 6, 2024 19:35
Home Assistant blueprint for Energy Disaggregation or Non-Intrusive Load Monitoring (NILM)
blueprint:
name: Energy Disaggregation
description: Approximate power usage of an appliance
domain: automation
input:
power_helper:
name: Input helper to store the approximate power usage
description: in W
selector:
entity:
@lidgnulinux
lidgnulinux / dwl-tags.sh
Last active May 8, 2022 23:03
Yambar-for-dwl
#!/usr/bin/env bash
# Variables
declare output title layout activetags selectedtags
declare -a tags name
readonly fname=/home/ahmad/.cache/dwltags
_cycle() {
tags=( "1" "2" "3" "4" "5" "6" "7" "8" "9" )
@nicedreams
nicedreams / bmenu.sh
Last active October 2, 2023 23:46
bmenu - Shell application launcher using fzf
#!/bin/bash
# bmenu - Shell application launcher using fzf.
# Searches $PATH for executable files and runs selected program.
# Fzf preview window shows info about file.
# Requires: fzf
# Usage: As script like ~/bin/bmenu or copy/paste bmenu() function in ~/.bashrc
bmenu() {
launchapp=$(IFS=':'; \
for p in ${PATH}; \
@taviso
taviso / .Xresources
Last active May 12, 2024 16:25
XTerm Configuration
! XTerm resources
!
! Remember to run `xrdb < .Xresources` after changing anything.
!
! Tavis Ormandy <taviso@gmail.com>
! Set the default UI font (menus, toolbar, etc)
XTerm*XftFont: Segoe UI:size=10:antialias=true:style=Regular
! Color of UI Components
@AlecsFerra
AlecsFerra / animated_wallpaper.c
Last active May 14, 2024 19:40
POC for simple animated wallpapers in Xorg
#define _POSIX_C_SOURCE 199309L
//#define DEBUG
#include <Imlib2.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
@cutiko
cutiko / Readme.md
Created November 22, 2019 18:24
Git delete last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

ORIGINAL did fork but search didn't helped me

@seven1m
seven1m / clipd
Last active March 24, 2020 14:42
simple clipboard history script for Sway window manager and dmenu (might work with other Wayland window managers too)
#!/usr/bin/env ruby
# https://mpov.timmorgan.org/clipboard-history-in-sway-window-manager/
require 'json'
STORE = "#{ENV['HOME']}/.clipboard-history"
LIMIT = 100
unless File.exist?(STORE)
@ernierasta
ernierasta / sway-record
Last active August 18, 2022 19:36
Swaywm screen and audio recording
#!/bin/bash
# Sway WM screen + audio recorder
# original author: Aaron D. Fields
# blog post: https://blog.spirotot.com/2017/08/21/a-dirty-hack-to-enable-acceptable-sway-wm-screen-recording/
# currently error 503 :-(
#
# Updated version: ernierasta
# Repo: https://gist.github.com/ernierasta
#
# Changelog:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
/**
* Set the WM_CLASS property of a window specified by it's ID
* Usage: set_wm_class <window id> <window class> <application name>
* Compile with: gcc set_wm_class.c -lX11 -o set_wm_class