Skip to content

Instantly share code, notes, and snippets.

View michaelmrose's full-sized avatar
💭
Available to hire

Michael Rose michaelmrose

💭
Available to hire
View GitHub Profile
@michaelmrose
michaelmrose / rshift.sh
Last active October 8, 2023 22:52
basic redshift like implimentation with bash
#!/bin/bash
monitors=$(xrandr --listactivemonitors | tail -n +2 | awk '{print $4}')
# Get the current hour
if [ "$#" -eq 1 ]; then
current_hour="$1"
else

RESTful Routes to CRUD Mapping

Example resource: posts

HTTP Method
(Verb)
Path/Endpoint/URI CRUD Operation Typical
Controller Action
Has Data
Payload
GET /posts Read all posts index No
GET /posts/:id Read a specific post show No
POST /posts Create a new post create Yes
PUT /posts/:id Update specified post update Yes
#!/bin/sh
export USER="michael"
export HOME="/usr/home/michael"
export DISPLAY=:0
export DISPLAY=$(who|grep michael| choose 4|cut -c 2-3)
groups="$(id -Gn "$USER" | tr ' ' ':')"
svdir="$HOME/service/enabled"
@michaelmrose
michaelmrose / output.txt
Created May 13, 2022 18:37
output of xbps-install -Su
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/nonfree/x86_64-repodata' ...
libblkid-2.38_1 in transaction breaks installed pkg `util-linux-2.37.2_2'
libfdisk-2.38_1 in transaction breaks installed pkg `util-linux-2.37.2_2'
libmount-2.38_1 in transaction breaks installed pkg `util-linux-2.37.2_2'
libsmartcols-2.38_1 in transaction breaks installed pkg `util-linux-2.37.2_2'
libuuid-2.38_1 in transaction breaks installed pkg `util-linux-2.37.2_2'
Transaction aborted due to unresolved dependencies.
Downstream Channels
Power Level: Signal to Noise Ratio:
Channel 1: 10.0 dBmV 39.8 dB
Channel 2: 10.3 dBmV 40.0 dB
Channel 3: 10.4 dBmV 39.8 dB
Channel 4: 10.5 dBmV 39.9 dB
Channel 5: 10.7 dBmV 39.8 dB
@michaelmrose
michaelmrose / mytabs.el
Created May 7, 2022 20:19
Emacs Powerline Tabs
;;; package -- Summary
;;; my tabs settings and configuration
;;; mytabs.el
;;; Commentary:
;;; Code:
;; Global Bindings
(require 'evil)
(global-set-key (kbd "C-t") 'tab-bar-new-tab)
@michaelmrose
michaelmrose / fdisk
Created February 24, 2022 19:47
fdisk -l output
Disk /dev/mtdblock0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mmcblk0: 116.5 GiB, 125090922496 bytes, 244318208 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
@michaelmrose
michaelmrose / switch-audio.fish
Created July 31, 2021 00:10
switch audio script
#!/usr/bin/env fish
# Requires both fish shell and ponymix to work
# https://github.com/falconindy/ponymix
function next-valid-index
set val $argv[1]
set lst $argv[2..-1]
set n (findindex $val $lst)
if test $n -ge (count $lst)
evdev:input:b*v05F3p00FF*
KEYBOARD_KEY_90001=f14
KEYBOARD_KEY_90002=f15
KEYBOARD_KEY_90003=f16
@michaelmrose
michaelmrose / anonymous-gist.
Created June 17, 2020 18:51
update-agenda-in-background
(defun mmr/agenda-to-html-in-background ()
(async-start (lambda ()
(save-excursion
(with-current-buffer (get-buffer-create "*Org Agenda*")
(org-agenda nil "a"))))
(lambda (a)
(with-current-buffer (htmlize-buffer (get-buffer "*Org Agenda*"))
(write-region (point-min) (point-max) "/tmp/agenda-web.html")))))