Skip to content

Instantly share code, notes, and snippets.

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

Matt invalidusrname

🤷‍♀️
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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
def get_collections(skuNo):
db = Database.Database('rugsystem_new')
db.local.execute("SELECT * FROM rugsystem_new.ul_skus US LEFT JOIN rugsystem_new.ul_designs UD ON US.design_id = UD.id LEFT JOIN rugsystem.ul_collections UC ON UD.collection_id = UC.id WHERE US.SkuNo = {}".format(int(skuNo)))
collect = {}
return collect
@invalidusrname
invalidusrname / install-ruby.sh
Created September 18, 2018 18:55
ruby 2.5.1 installation via rbenv
sudo apt-get update
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs
sudo apt-get install yarn
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
@invalidusrname
invalidusrname / heroku_lol.log
Last active April 3, 2019 21:02
I haven't touched heroku in over a year. Went to update an existing app.
heroku
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x3030ba6a7059 pc=0x1a0970]
goroutine 1 [running]:
runtime.throw(0x4515a0, 0x2a)
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/panic.go:527 +0x90 fp=0xc8200fbbf8 sp=0xc8200fbbe0
runtime.sigpanic()
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/sigpanic_unix.go:12 +0x5a fp=0xc8200fbc48 sp=0xc8200fbbf8
sync.(*Pool).Get(0x5b0820, 0x0, 0x0)