defmodule TravelerWeb.SearchbarLive do | |
use TravelerWeb, :live_view | |
alias Phoenix.LiveView.JS | |
alias Traveler.Places | |
def mount(_params, _session, socket) do | |
socket = assign(socket, places: []) | |
{:ok, socket, layout: false} | |
end |
/** | |
* Allows for recording a sequence of keys pressed | |
* and matching against that sequence. | |
* | |
* Taken from the livebook repo and adapted a little bit. | |
*/ | |
export class KeyBuffer { | |
private resetTimeout: number; | |
private buffer: string[] = []; | |
private resetTimeoutId: number | null = null; |
# I'll be doing another one for Linux, but this one will give you | |
# a pop up notification and sound alert (using the built-in sounds for macOS) | |
# Requires https://github.com/caarlos0/timer to be installed | |
# Mac setup for pomo | |
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\ | |
-title 'Work Timer is up! Take a Break 😊'\ | |
-appIcon '~/Pictures/pumpkin.png'\ | |
-sound Crystal" |
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:
defmodule Day3 do | |
# Since my last answer wasn't purely Nx, I'm going | |
# to try to stick to Nx as much as is possible, but | |
# we don't have string manipulation stuff so that will | |
# have to be done in Elixir | |
import Nx.Defn | |
def part1 do | |
File.read!("aoc/3.txt") | |
|> parse_input() |
Das BMVI hat eine völlig nutzlose App gebaut. Eine Autobahn-Info App.
Nein, es gibt jetzt nämlich eine offene API für aktuelle Verwaltungsdaten in Bezug auf Baustellen-Informationen, Webcams, Parkplätze, … - bestimmt für jemand nützlich.
Hier gibt es eine OpenAPI Spec von @creckord: https://gist.github.com/creckord/a2e09267f5fdfadc2cd75eedb3182b8a
.SILENT: | |
.PHONY: help | |
## This help screen | |
help: | |
printf "Available targets\n\n" | |
awk '/^[a-zA-Z\-\_0-9]+:/ { \ | |
helpMessage = match(lastLine, /^## (.*)/); \ | |
if (helpMessage) { \ | |
helpCommand = substr($$1, 0, index($$1, ":")-1); \ |
# Replace! | |
# [!server!] (the forge server instance) | |
# [!sudo_password!] (random password for sudo) | |
# [!db_password!] (random password for database user) | |
# [!user.name!] (git user name) | |
# [!user.email!] (git user email) | |
# [!server_ip!] (git user email) | |
# | |
# REQUIRES: |