Skip to content

Instantly share code, notes, and snippets.

View arusa's full-sized avatar

Alexander Rusa arusa

View GitHub Profile
@joemasilotti
joemasilotti / Endpoint.swift
Last active May 28, 2023 16:54
A Rails-like environment helper for iOS apps, from https://masilotti.com/rails-like-endpoint-switcher-for-ios-apps/
import Foundation
enum Environment: String {
case development, staging, production
}
extension Environment {
static var current: Environment {
if isAppStore {
return .production
@glaszig
glaszig / curl_action_mailbox.md
Last active June 27, 2023 08:53
rails' action mailbox without installing rails on your mail server

forward email to action mailbox without installing rails

rails provides [rake tasks][rake] to forward mails to [action mailbox][actionmailbox]'s [relay ingress][postfix]. that's fine unless you have your mail server(s) on another system and don't want to install rails (and all dependencies, i.e. the ruby runtime).
since the rake tasks basically just [upload stdin to your rails app via http][relayer] you can do everything with curl.

action-mailbox-relayer.sh

#!/usr/bin/env sh
curl -sS -u "actionmailbox:$INGRESS_PASSWORD" \