Skip to content

Instantly share code, notes, and snippets.

View mikeboiko's full-sized avatar

Mike mikeboiko

  • Calgary, Canada
View GitHub Profile
@Ultra9k
Ultra9k / motion_switch_light.yaml
Last active April 9, 2024 19:03
This is a blueprint based on the original motion_light from Home Assistant. This one, however, allows you to control not only lights but also switches when motion is detected.
blueprint:
name: Motion-activated Switch and/or Light
description: Turn on a switch and/or light when motion is detected.
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
@mikeboiko
mikeboiko / git-credential-rbw
Last active March 31, 2024 13:55
Use bitwarden rbw as git-credential helper
#!/usr/bin/env bash
# rbw git-credential helper
# Based on https://github.com/lastpass/lastpass-cli/blob/master/contrib/examples/git-credential-lastpass
# A credential helper for git to retrieve usernames and passwords from rbw.
# For general usage, see https://git-scm.com/docs/gitcredentials.
# Here's a quick version:
# 1. Put this somewhere in your path.
# 2. git config --global credential.helper rbw
esphome:
name: fairy_light_1
platform: ESP32
board: nodemcu-32s
# wifi settings
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pw
power_save_mode: none
@Icaruk
Icaruk / multipleGitProfiles.md
Last active April 18, 2024 12:58
How to have multiple profiles on git

Last update: 30-01-2024
Last view: 30-01-2024

Step 1

Go to your work folder, mine is located at: F:/Work/EnterpriseName/

And then create a .gitconfig-work with the following data:

@mikeboiko
mikeboiko / tmux.conf
Last active March 23, 2024 07:32
Automatically update $DISPLAY for each tmux pane after attaching to session
set-hook -g client-attached 'run-shell /bin/update_display.sh'
@norcalli
norcalli / yay-update-ignore-errors
Last active February 22, 2023 09:34
A wrapper script to run yay and incrementally build a list of packages to ignore if they error out.
#!/bin/sh
# Wrapper script around yay to try to ignore errors
# Copyright © 2019 Ashkan Kiani
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
@sjoegren
sjoegren / vim-tmux-navigator-is-vim.sh
Created April 27, 2018 14:11
vim-tmux-navigator-is-vim workaround for vim-tmux-navigator https://github.com/christoomey/vim-tmux-navigator/issues/195
#!/bin/bash
# Workaround for issue https://github.com/christoomey/vim-tmux-navigator/issues/195
# where vim is running in a subshell.
#
# Usage: Update vim-tmux-navigator config in .tmux.conf with:
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$' \
# || vim-tmux-navigator-is-vim.sh #{pane_tty}"
@mikeboiko
mikeboiko / pagination.py
Last active November 22, 2020 14:07
Django Rest Framework Pagination integration with Vuetable-2
# =======================================================================
# === Description ...: Integrate DRF with VueTable-2
# === Author ........: Mike Boiko
# =======================================================================
# If you want to integrate Django Rest Pagination with VueTable, you must
# change the pagination as shown below:
# Then, in your views.py file, the pagination_class must be set to CustomPagination
# See example below:
# from rest_framework import pagination
@mrlesmithjr
mrlesmithjr / ansible-macos-homebrew-packages.yml
Last active April 29, 2024 10:40
Install MacOS Homebrew Packages With Ansible
---
- name: Install MacOS Packages
hosts: localhost
become: false
vars:
brew_cask_packages:
- atom
- docker
- dropbox
- firefox
def dump_func_name(func):
def echo_func(*func_args, **func_kwargs):
print('')
print('Start func: {}'.format(func.__name__))
return func(*func_args, **func_kwargs)
return echo_func
class ClassName(object):
@dump_func_name