Skip to content

Instantly share code, notes, and snippets.

View nicjansma's full-sized avatar

Nic Jansma nicjansma

View GitHub Profile
@nolanlawson
nolanlawson / scaling_mastodon_down.md
Last active November 17, 2024 16:12
Scaling Mastodon down

Scaling Mastodon down

There is already a guide on scaling your Mastodon server up. This is a short guide on scaling your Mastodon server down.

I.e., maybe you want to run a small instance of <100 active users, and you want to keep your cloud costs reasonable. So you might be running everything on a single machine, with limited memory and CPU. (In my case, I was using a t3.medium instance with 2 vCPUs and 4GB of RAM.) How do you do this?

Note that I'm not a Ruby or Sidekiq expert, and most of this stuff I figured out through trial and error.

@simonhearne
simonhearne / mPulse_postman.json
Created February 20, 2020 14:46
A Postman collection for interacting with mPulse APIs
{
"info": {
"_postman_id": "7eaf462d-6713-446d-9872-0c5ecef206d8",
"name": "mPulse",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Annotations",
"item": [
#!/bin/bash
curl -L -O https://downloads.redisinsight.redislabs.com/latest/redisinsight-linux64
chmod +x redisinsight-linux64
./redisinsight-linux64
@mergwyn
mergwyn / zfsbench
Last active March 13, 2025 08:36
ZFS benchmarking using fio
#!/usr/bin/env bash
set -o errexit
echo $(date):Random read
fio --filename=test --sync=1 --rw=randread --bs=4k --numjobs=1 \
--iodepth=4 --group_reporting --name=test --filesize=10G --runtime=300 && rm test
echo $(date):Random write
fio --filename=test --sync=1 --rw=randwrite --bs=4k --numjobs=1 \
@ferenczy
ferenczy / atom-get-lost-unsaved-buffers.js
Last active May 29, 2024 21:09
Get lost unsaved buffers in Atom editor: Load text content of all unsaved buffers stored by Atom for any project and print it to Developers tools console
/**
* Get lost unsaved buffers in Atom editor
*
* Load text content of all unsaved buffers stored by Atom for any project in IndexedDB and print it to Developers tools console
*
* Author: David Ferenczy Rogožan (https://ferenczy.cz)
*
* Instructions:
*
* 1. Start Atom
@bradwestfall
bradwestfall / HoC-vs-RenderProps-vs-Hooks.md
Last active April 14, 2025 16:47
An explanation of why Hooks are a nicer way to abstract re-useable state and functionality vs HoC's and Render Props

HoC (pattern) vs Render Props (pattern) vs Hooks (not pattern, a new API)

Someone was asking me about comparing the HoC and Render Props patterns (and their shortcomings) to hooks. I might leave this up as a public gist for others if it's helpful.


tldr;

Issues with HoC:

@querymetrics
querymetrics / loader-onload.js
Last active November 14, 2017 22:54
mPulse Loader snippet that delays Boomerang loading until onLoad has occurred
<script>
(function(){
if (window.BOOMR && window.BOOMR.version) { return; }
var win = window;
function boomerangSaveLoadTime(e) {
win.BOOMR_onload=(e && e.timeStamp) || new Date().getTime();
}
function boomerangLoad() {
@troyfontaine
troyfontaine / 1-setup.md
Last active May 9, 2025 22:20
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@porjo
porjo / dump_route53_records.md
Last active February 12, 2025 02:08
Export route53 records to CSV

Retrieve hosted zones with aws route53 list-hosted-zones then enter the zone Id below:

aws route53 list-resource-record-sets --hosted-zone-id "/hostedzone/xxxxxxxxxxx" | \
   jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?]  | @tsv'
@graymouser
graymouser / hb_all_books_dl.js
Created February 28, 2016 14:09
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
*/
$('a').each(function(i){
if ($.trim($(this).text()) == 'MOBI') {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
});