Skip to content

Instantly share code, notes, and snippets.

View mikeboiko's full-sized avatar

Mike mikeboiko

  • Calgary, Canada
View GitHub Profile
@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}"
@jdoconnor
jdoconnor / gist:6876052
Last active March 23, 2020 15:21
loop through tmux windows, control c and exit
tmux list-window | awk -F":" '{system("tmux select-window -t "$1"; tmux send-keys C-c; tmux send-keys \"exit\"; tmux send-keys Enter")}'; tmux attach
@tlatsas
tlatsas / arch_kvm_install.md
Last active March 27, 2020 18:26
archlinux kvm guest install cheatsheet
  • partitions
    • use the tool of your choice (fdiks/gdisks/parted)
  • filesystems
    • mkfs -t <fs-type> /dev/<partition>
  • mount partitions on /mnt
  • setup network
    • ip address add <IP>/<CIDR> dev eth0
    • ip route add default via <GW>
    • add dns in /etc/resolve.conf
  • select pacman mirror
@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
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
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
@yevgenko
yevgenko / .Xdefaults
Created August 24, 2011 02:58
URxvt settings with solarized theme
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@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,
@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'
@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