Skip to content

Instantly share code, notes, and snippets.

View devnulled's full-sized avatar

Brandon Harper devnulled

View GitHub Profile
@jdarcy
jdarcy / activitypub.md
Created November 9, 2022 16:10
Some thoughts about ActivityPub

I've commented a few times about some issues I see with the scalability of ActivityPub - the protocol behind the Fediverse and its best-known implementation Mastodon. A couple of folks have asked for more elaboration, so ... here it is.

First, let me add some disclaimers and warnings. I haven't devoted a lot of time to looking at ActivityPub, so there might be some things I've misunderstood about it. On the other hand, I've brought bigger systems - similar node counts and orders of magnitude more activity per node - from broken to working well based on less study of the protocols involved. So if you want to correct particular misconceptions, that's great. Thank you in advance. If you want to turn this into an appeal to authority and say that I'm wrong only because I haven't developed a full ActivityPub implementation or worked on it for X years ... GTFO.

What

What is ActivityPub? It's an HTTP- and JSON-based protocol for exchanging information about "activities". An activity could be many things.

@MelbourneDeveloper
MelbourneDeveloper / Stuff That Software Developers Do.md
Last active April 15, 2024 12:30
Stuff That Software Developers Do

Stuff That Software Developers Do

This is a list of stuff that the average software developer does from week to week

Coding

  • Code design
  • Refactoring
  • Algorithms
  • Profiling
  • Code reviews
  • Building frameworks
@mobeigi
mobeigi / slack_user_noti_pref_bulk_update.js
Last active October 17, 2022 19:24
Slack User Notification Preference Bulk Update
// Slack User Notification Preference Bulk Update
// By Mo Beigi
const slackTeamId = "EXAMPLE17";
const localConfigJson = JSON.parse(localStorage.localConfig_v2);
const slackUrl = localConfigJson.teams[slackTeamId].url;
let channel_ids = [];
// client.boot contains list of channel ids user is subscribed to amongst other things
await fetch(slackUrl + "api/client.boot?" +
@transhapHigsn
transhapHigsn / nodes-gc.py
Last active December 28, 2020 22:25
K3s garbage collect expired passwords for nodes in cluster
# steps
# 1. echo -n $(sudo cat /var/lib/rancher/k3s/server/cred/node-passwd) > node-pass
# 2. set kube context, export KUBECONFIG=/path/to/kube/config.yaml
# 3. python node-gc.py
# 4. sudo mv check-pass /var/lib/rancher/k3s/server/cred/node-passwd
# NOTE: Also you can just create cron job that clears content of the file(/var/lib/rancher/k3s/server/cred/node-passwd),
# works very well.
import subprocess
@hermanbanken
hermanbanken / Dockerfile
Last active June 9, 2024 22:18
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@christianvozar
christianvozar / Makefile
Last active January 8, 2018 19:23
Example to Verify Application Dependence in Make
# Make example for verifying application dependancies for execution
# Christian R. Vozar <christian@rogueethic.com>
dependencies:
$(call isinstalled,kubectl)
define isinstalled
@hash $(1) >/dev/null 2>/dev/null || { echo >&2 "$(1) required but not found. Aborting."; exit 1; }
endef
nathantech:
are none of the Denver companies offering relocation expenses?
marc:
i dont think Denver is that desperate for engineers, but probably on a case by case basis
nathantech:
SF companies offer relocation a ton
nathantech:

Getting Started in Scala

This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere…  I hope to present the information you need without assuming anything.

Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!

One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.

Getting the JVM

@kixorz
kixorz / ec2hostname.rb
Last active June 3, 2022 11:27
EC2 Instance Route53 Hostname registration init.d script. Instance needs to have the attached IAM instance role policy applied.
#!/usr/bin/ruby
# chkconfig: 35 99 01
# description: EC2 DNS registration
# processname: ec2hostname
require 'aws-sdk'
require 'net/http'
`touch /var/lock/subsys/ec2hostname`
@jdegoes
jdegoes / die-flags-die.md
Created October 8, 2014 17:20
Death to Boolean Flags

Refactoring Booleans to Functions

Boolean parameters are a plague, responsible for non-composable, monolithic functions that never quite do enough, and countless programming bugs:

  • "Oops, meant to pass that as the 2nd boolean flag, not the 1st!"
  • "Oops, accidentally inverted the meaning of that boolean in the implementation!"
  • "Oops, the function isn't flexible enough for my use case, let's add a 6th boolean flag!"
  • "Oops, got the meaning of that boolean flag wrong, time to dig into the source code!"

All boolean parameters should be refactored into functions that effect the change otherwise encoded in the parameter.