Skip to content

Instantly share code, notes, and snippets.

View invalidusrname's full-sized avatar
🤷‍♀️

Matt invalidusrname

🤷‍♀️
View GitHub Profile
@invalidusrname
invalidusrname / tmux_256_colors.pl
Last active April 3, 2024 17:56
tmux 256 colors
#!/usr/bin/perl
# displays the 256 colors specified in tmux's "colourNN" way.
# June, 1st 2011 by Yasunori Taniike (@ytaniike).
use strict;
use warnings;
my $prefix_bl = "\x1b[38;5;0;48;5;";
my $prefix_wl = "\x1b[38;5;15;48;5;";
my $suffix = "\x1b[0m";
@invalidusrname
invalidusrname / install_dash_gem_docs.rb
Created August 26, 2020 12:23 — forked from jasonnoble/install_dash_gem_docs.rb
Installs the Dash docs for all the Ruby Gems in your Gemfile
#!/usr/bin/env ruby
#
# Prerequisites:
# gem install bundler
# bundle install
dependencies = `bundle show | grep '*' | awk '{print $2, $3}' | sed -e 's/(//' -e 's/)//'`.split("\n")
dependencies.each do |dependency|
(gem_name, version) = dependency.split
@invalidusrname
invalidusrname / gpg_commit_error.log
Last active January 10, 2023 15:11
GPG trouble signing git commits
$ GIT_TRACE=1 git commit -a -S -m 'whitespace'
10:21:20.904618 git.c:415 trace: built-in: git commit -a -S -m whitespace
10:21:20.907237 run-command.c:637 trace: run_command: gpg --status-fd=2 -bsau E288164435BD1457
error: gpg failed to sign the data
fatal: failed to write commit object
$ gpg --status-fd=2 -bsau E288164435BD1457
[GNUPG:] KEY_CONSIDERED 02FE60A5E2F61054A2159661E288164435BD1457 2
[GNUPG:] BEGIN_SIGNING H8
^C
@invalidusrname
invalidusrname / mermaid.md
Created January 7, 2023 03:08 — forked from martinwoodward/mermaid.md
GitHub HTML Rendering Pipeline
```mermaid
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
 iframe->>dotcom: iframe ready
@invalidusrname
invalidusrname / show_vars.sh
Created September 27, 2017 16:44
simulate bash login and show variable sources
PS4='+$BASH_SOURCE> ' BASH_XTRACEFD=7 bash -xl 7>&2
@invalidusrname
invalidusrname / entity.py
Last active October 29, 2019 18:54
Entity object
# .
# ├── lib
# │   ├── __init__.py
# │   ├── entity
# │   │   ├── __init__.py
# │   │   ├── entity.py
# │   │   └── job_post_entity.py
# │   └── repository
# │   ├── __init__.py
# │   ├── job_post_repository.py
@invalidusrname
invalidusrname / smorgasbord.py
Last active October 29, 2019 18:33
Entites and Repositories
import pytest
import json
# ---------------------------- #
# lib/entities/entity.py
# ---------------------------- #
class Entity(object):
@invalidusrname
invalidusrname / xmu_indie_500.txt
Created May 27, 2019 14:19
Sirius XMU Indie 500 Playlist
Arcade Fire - Wake Up
Modest Mouse - Float On
The Shins - New Slang
Franz Ferdinand - Take Me Out
Pixies - Where Is My Mind?
The Strokes - Last Nite
LCD Soundsystem - All My Friends
Yeah Yeah Yeahs - Maps
Arctic Monkeys - Do I Wanna Know?
Vampire Weekend - A-Punk
@invalidusrname
invalidusrname / user.rb
Last active April 3, 2019 21:13
Owned Sites
class User < ApplicationRecord
has_many :site_users, dependent: :destroy
has_many :sites, through: :site_users
def owned_sites
sites.where("site_users.roles_mask = ?", SiteUser.mask_for(:owner))
end
def owned_sites_using_includes
sites.includes(:site_users).where("site_users.roles_mask = ?",SiteUser.mask_for(:owner))
@invalidusrname
invalidusrname / curling.log
Last active April 3, 2019 21:07
curling some stuff
for url in $(cat ~/urls.txt); do curl --write-out "$url | %{http_code} | %{time_total}\n" --silent -o /dev/null $url; done| sed 's/\(^.*\)\|/<li>\1/g' | sed 's/$/<\/li>/g'