Skip to content

Instantly share code, notes, and snippets.

View timriley's full-sized avatar
🇺🇦
Standing with Ukraine

Tim Riley timriley

🇺🇦
Standing with Ukraine
View GitHub Profile
@pda
pda / poorman
Last active February 16, 2024 00:00
poorman: a Procfile runner for tmux, in terrible bash
#!/bin/bash
set -e -o pipefail -u
# Launches each Procfile service as a tmux pane in a background window.
# The window is created if it doesn't already exist.
# Panes are created on demand, and existing panes are restarted if stopped.
WINDOW_NAME="poorman"
if [[ ${1:-} == "stop" ]]; then
@dan-manges
dan-manges / _pub_sub.md
Last active April 12, 2023 13:45
in process pub sub implementation in Ruby

Ruby Pub/Sub

This is an implementation of in-process pub/sub in Ruby with type checking at runtime.

It only allows subscribing to events with jobs to ensure that the subscriber blocks are fully asynchronous and cannot cause runtime exceptions.

This is the approach we use in production at rwx

@TomFaulkner
TomFaulkner / Yabai_Configs.md
Last active February 27, 2024 23:38
Yabai configs

This is my current (as of 4/30/2020) Yabai and skhdrc config as well as the Ubersicht (http://tracesof.net/uebersicht/) widget I use rather than the Yabai status bar. I went this route rather than the built-in status bar because I didn't like how Yabai as of 2.0.1 handled multiple monitors in the status bar.

Nothing is too far from defaults here, and the spaces.coffee was something I found linked in an issue on Yabai's github page.

@fabiolimace
fabiolimace / UUIDv6.sql
Last active May 12, 2024 03:47
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@swyxio
swyxio / cloudos.md
Last active May 3, 2023 12:23
Cloud Operating Systems and Reconstituting the Monolith. tweet responses: https://twitter.com/swyx/status/1226257539886669825?s=20
@ntl
ntl / pattern-matching.rb
Created June 15, 2018 21:02
Conditional Examples in Ruby
# This is an example using Eventide's message handling DSL for declaring different
# handler methods based on message type
class SomeHandler
include Messaging::Handle
handle SomeMessage do |some_msg|
# ...
end
handle OtherMessage do |other_msg|
@rubencaro
rubencaro / setup_go.md
Last active April 28, 2024 21:52
Golang installation guide

Golang installation guide

Since Golang version 1.11 this process is finally (almost) as easy as it should (!!). You can see full docs here. For older guides see here.

These are my notes, not a generic solution. They are not meant to work anywhere outside my machines. Update version numbers to whatever are the current ones while you do this.

Installing everything needed the first time

Install asdf and its golang plugin, then install golang

Setting up pghero

Install docker for Mac

https://www.docker.com/docker-mac

Install pghero

Run the following commands

localip=$(ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\  -f2)
dburl=postgres://venkat@docker.local:5432/turtle_dev
@benschwarz
benschwarz / pg.md
Last active December 15, 2020 04:20
Awesome postgres
@mihow
mihow / load_dotenv.sh
Last active May 4, 2024 12:32
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi