We'll be comparing the following:
Deploying a Phoenix app to Fly.io is a breeze...is what everyone kept telling me. In fairness, I imagine the process would have been breezier had I just used postgres, but all the sqlite and litestream talk has been far too intriguing to ignore. "Wait", you say. "It is just a flat file. How much harder can it be?"
It is easy to make something harder than it should be. It is hard to take something complex and make it truly simple. flyctl launch
does an amazing job at providing a simple interface to the utterly complex task of generating deployment resources, especially now that we are living in a containerd
(erm, firecracker) world.
This gist is for anyone who, like me, thinks they know better than to read all of the documentation and therefore necessari
# Rails production setup via SQLite3 made durable by https://litestream.io/ | |
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
# | |
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
# | |
# in production you might want to map /data to somewhere on the host, | |
# but you don't have to! | |
# | |
FROM ruby:3.0.2 |
import type { Action, Loader } from "@remix-run/loader"; | |
import { json, parseFormBody, redirect } from "@remix-run/loader"; | |
import { readTodos, createTodo, deleteTodo } from "../data/todo"; | |
let action: Action = async ({ request, context: { session } }) => { | |
let [method, body] = await methodOverride(request); | |
await new Promise((res) => setTimeout(res, 1000)); | |
switch (method) { | |
case "post": { | |
let [_, error] = await createTodo(body!.name); |
Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.
Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.
{ | |
"lv_module": { | |
"scope": "elixir, html-eex", | |
"prefix": "lv", | |
"body": [ | |
"defmodule ${1}Web.${2}Live do", | |
" use ${1}Web, :live_view", | |
"end" | |
], | |
"description": "LiveView module" |
On void linux. | |
Under `/etc/containers/` there is a file called `registries.conf`. It is complemented by `man 5 containers-registries.conf`. | |
Change (for me lines 11-12) which say | |
[registries.search] | |
registries = [] | |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Twitter Archive Viewer</title> | |
<script>window.YTD = { tweet: {} }</script> | |
<script src="tweet.js"></script><!-- this is loading a file from the archive --> | |
<style> | |
.tweet { border: 1px solid #eee; margin: 8px } | |
.full_text { padding: 8px } | |
.created_at { padding: 8px; color: #777 } | |
</style> |
/** | |
* Basic example of routerless store based routing. | |
* To understand what is going on check out | |
* https://svelte.dev/tutorial/writable-stores | |
* https://www.npmjs.com/package/feather-route-matcher | |
*/ | |
// stores.js |
Copyright © <year>
<copyright holders>
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