Mix.install([
{:liveview_playground, "~> 0.1.8"},
{:phoenix_ecto, "~> 4.5"},
{:ecto, "~> 3.11"},
{:ecto_sqlite3, "~> 0.13"}
])
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')" | |
# syntax = docker/dockerfile:1.4.0 | |
FROM node:20 | |
WORKDIR /root | |
RUN npm install sqlite3 |
// This script may be run in a Chrome dev console, and will delete all the device config variables for each device in a fleet, | |
// which the exception of *_SUPERVISOR_DELTA or *_SUPERVISOR_DELTA_VERSION. | |
await (async () => { | |
// Make sure FLEET_ID is the ID of your fleet. | |
const FLEET_ID = 12345; | |
// Get devices in fleet | |
const devices = await sdk.models.device.getAllByApplication(FLEET_ID, { | |
$select: 'id', | |
}); |
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
Replace loopN with loop number listed with partx
command
balena os download raspberrypi4-64 -o rpi4.img
losetup -fP --show rpi4.img
mount /dev/loopNp6 $MOUNTPOINT
If the mount fails with wrong fs type
or similar, this is most likely because the image is a flasher image (i.e. for Intel NUC, for example), and you will need to do the following:
defmodule ExampleWeb.ArticleLive.Index do | |
alias Example.{Articles, Tags} | |
alias ExampleWeb.{ArticleLive, ComponentLive, Query} | |
use ExampleWeb, :live_view | |
@impl true | |
def render(assigns) do | |
~L""" | |
<div class="container max-w-screen-md mx-auto pt-6"> |
FROM node:10.15-alpine as base | |
RUN apk --no-cache --virtual build-dependencies add \ | |
python \ | |
make \ | |
g++ \ | |
&& rm -f /var/cache/apk/* \ | |
&& npm config set unsafe-perm true \ | |
&& npm install --quiet node-gyp -g --cache /tmp/empty-cache |
// This is an advanced example! It is not intended for use in application code. | |
// Libraries like Relay may make use of this technique to save some time on low-end mobile devices. | |
// Most components should just initiate async requests in componentDidMount. | |
class ExampleComponent extends React.Component { | |
_hasUnmounted = false; | |
state = { | |
externalData: null, | |
}; |
import { browserHistory } from 'react-router'; | |
/** | |
* @param {Object} query | |
*/ | |
export const addQuery = (query) => { | |
const location = Object.assign({}, browserHistory.getCurrentLocation()); | |
Object.assign(location.query, query); | |
browserHistory.push(location); | |
}; |