Skip to content

Instantly share code, notes, and snippets.

@sorentwo
sorentwo / oban_from_rails.md
Created August 22, 2022 20:02
Guide for inserting Oban jobs from Rails

Migrating background jobs to Elixir is easy with Oban because everything lives in your PostgreSQL database. Oban relies on a structured oban_jobs table as its job queue, and purposefully uses portable data structures (JSON) for serialization. That makes it enqueueing jobs into Oban simple for any language with a PostgreSQL adapter, no Oban client necessary.

As a demonstration, let's explore inserting Oban jobs from a Rails application.

To start, define a skeletal ActiveRecord model with a few conveniences for scheduling jobs:

@wlib
wlib / LICENSE
Last active June 10, 2022 22:14
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
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
furnished to do so, subject to the following conditions:
#!/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.
@chrismccord
chrismccord / phx-1.4-upgrade.md
Last active June 16, 2023 06:22
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new phx.new project generator

The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run:

@serradura
serradura / README.md
Last active April 21, 2022 19:33
Microtest - A xUnit family unit testing microframework for Ruby. (https://rubygems.org/gems/u-test)

µ-test (Microtest)

A xUnit family unit testing microframework for Ruby.

Prerequisites

Ruby >= 2.2.2

Installation

@ldez
ldez / gmail-github-filters.md
Last active April 3, 2024 11:53
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
@igorescobar
igorescobar / ssh_config.sh
Created March 3, 2017 14:22
Connect to a PRIVATE machine through a PUBLIC machine.
# put this in your ~/.ssh/config
Host public.host
HostName $ip
User $username
IdentityFile $identity_file_path
Host private.host
ProxyCommand ssh -q -W $private_ip:$private_local_port public.host
User $username
IdentityFile $identity_file_path
@reborg
reborg / rich-already-answered-that.md
Last active February 23, 2024 13:09
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@dgmorales
dgmorales / vaga
Last active March 21, 2019 17:42
Desenvolvedor de Infraestrutura
(essa é uma área de infraestrutura, mas é preciso reforçar que estamos procurando avidamente também perfis mais focados em
desenvolvimento que queiram se encaixar dentro dela)
Estamos buscando um profissional que consiga trabalhar em um time multidisciplinar, que tenha sólidos conhecimentos de
programação, bons fundamentos de sistemas operacionais e redes, experiência com tecnologias de automação, e facilidade para
trabalhar com metodologias ágeis dentro de uma cultura DevOps. Um perfil curioso e autodidata, com interesse em grandes
desafios técnicos.
@skosch
skosch / grafana_dashboard.json
Last active January 23, 2022 01:18
Very simple Grafana dashboard for Prometheus Elixir metrics
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}