Skip to content

Instantly share code, notes, and snippets.

View danhorst's full-sized avatar
🛳️
SHIP IT

Dan Brubaker Horst danhorst

🛳️
SHIP IT
View GitHub Profile
@virolea
virolea / client_middleware.rb
Created April 25, 2023 19:29
Code for the "A simple and pragmatic approach to fixing a memory leak" talk at RailsConf 2023
# This middleware dynamically switch a job queue based on its class name.
module TroubleshootMemoryMiddleware
module Client
class CustomQueueName
QUARANTINE_QUEUE = "quarantine"
def call(worker_class, job, queue, redis_pool)
# Jobs enqueued without ActiveJob are not wrapped.
job_class_name = if job["wrapped"].present?
@WillianTomaz
WillianTomaz / wsl2-with-1password-info.md
Last active March 21, 2024 01:26
Instructions for using 1Password SSH Agent with WSL2 (on Windows 11)

Saturday, April 22, 2023

How to Use 1Password SSH Agent with WSL2 (on Windows 11)

  • Note:

    • Always look for the official documentation, this tutorial may not suit you as there are new updates to the installation process.
    • References are at the end of the document.
  • Was used:

    • Windows 11 (x64)
    • WSL 2 (Ubuntu 22.04.2 LTS)
@DivineDominion
DivineDominion / kramdown_gfm_wikilink.rb
Created April 22, 2021 10:13
Kramdown GFM Parser extension for [[wikilinks]]
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@1000miles
1000miles / Heroku-CLI-Cheatsheet.md
Last active July 20, 2023 03:45
Most basic Heroku cli commands
@armetiz
armetiz / 01_1_wkhtmltopdf_dependencies.config
Created May 7, 2019 14:21
wkhtmltox-0.12.5-1 AWS ElasticBeanstalk AMI 2018.03
packages:
yum:
zlib: []
fontconfig: []
freetype: []
libX11: []
libXext: []
libXrender: []
xorg-x11-fonts-75dpi: []
xorg-x11-fonts-Type1: []
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@munificent
munificent / generate.c
Last active March 18, 2024 08:31
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u