Skip to content

Instantly share code, notes, and snippets.

[Unit]
After=docker.service docker.socket
After=ifup@eth0.service
Wants=ifup@eth0.service
[Service]
ExecStart=/usr/bin/docker run \
--rm \
--name=traefik \
@eljojo
eljojo / hardware-raspberry-pi.nix
Created January 9, 2022 01:12
nixos raspberry pi
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
"${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/2a7063461c3751d83869a2a0a8ebc59e34bec5b2.tar.gz" }/raspberry-pi/4"
];
boot.kernelPackages = pkgs.linuxPackages_rpi4;
boot.kernel.sysctl."vm.swappiness" = 0;
@eljojo
eljojo / Item URI2.js
Created December 21, 2022 16:54
zotero uri
{
"translatorID":"90ed0f17-6ead-42fe-afb9-d34adb230099",
"translatorType":2,
"label":"Item URI para cucho",
"creator":"jojo",
"target":"html",
"minVersion":"2.0",
"maxVersion":"",
"priority":200,
"inRepository":false,
@eljojo
eljojo / css_classes.rb
Last active June 18, 2023 23:41
proof of concept on how to have Phlex generate CSS classes
# frozen_string_literal: true
module Views
module CssClasses
extend ActiveSupport::Concern
class CssHelper; end
class_methods do
def css_helper
@eljojo
eljojo / function.rb
Last active July 20, 2023 06:08
Simple Open AI API Client
# frozen_string_literal: true
module Ai
class Function
# Returns a formatted function payload
def to_payload
{
"name" => name,
"description" => description,
"parameters" => parameters,