Skip to content

Instantly share code, notes, and snippets.

@floscr
floscr / main.rs
Created February 9, 2024 10:48
Iced example
use iced::theme::Theme;
use iced::widget::{column, container, text, text_input};
use iced::window::{self};
use iced::{Application, Element, Settings};
use once_cell::sync::Lazy;
#[derive(Debug, Default)]
struct State {
query: String,
}
@floscr
floscr / test_biff_tx.clj
Last active February 23, 2023 17:31
Biff Testing submit-tx
(ns com.test-biff-tx
(:require
[com.biffweb :as biff]
[malli.core :as malc]
[malli.registry :as malr]
[xtdb.api :as xt]))
;; We use this to convert keys to ids, for easy access and without having to change the malli uuid schema
(defn string-to-uid [s]
(let [bytes (.getBytes (str s))]
@floscr
floscr / bookmarklet.js
Last active November 24, 2022 07:51 — forked from bramus/bookmarklet.md
Mastodon User Page Bookmarklet
javascript:(function(){
const MY_MASTO_LOCAL_DOMAIN = 'functional.cafe'; /* 👈 Change this value */
const MY_MASTO_WEB_DOMAIN = MY_MASTO_LOCAL_DOMAIN; /* 👈 Only change this value if your Masto host is hosted an different domain than the LOCAL_DOMAIN */
function tryAndGetUserName() {
if (document.location.host === MY_MASTO_LOCAL_DOMAIN) {
alert(`Already on your host ${MY_MASTO_LOCAL_DOMAIN}`)
}
/* Profile with a moved banner (e.g. https://mastodon.social/@bramus): follow that link */
@floscr
floscr / x.nix
Last active April 7, 2022 10:15
Elden Ring Nix Tests
# e595 nixOS device configuration
{ config, pkgs, lib, ... }:
{
boot = {
kernelParams = [ ];
kernelModules = [ "thinkpad_acpi" "acpi_call" "kvm_amd" ];
initrd.kernelModules = [ "amdgpu" ];
extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
{
utils.mkBinding "Super + @space" "rofi";
}
@floscr
floscr / instructions.md
Last active February 11, 2021 14:49
Personio Export Timetracking Sheet to CSV
  • Edit the first 3 variables with your personal information
  • Navigate to your wanted months attendance page
  • Paste the contents of the js file to your console
  • This script only works with english language settings in personio
@floscr
floscr / service.nix
Created February 19, 2020 17:51
Not Working: Starting service from udev
{
systemd.user.services."setup-keyboard" = {
enable = true;
description = "Load my keyboard modifications";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "forking";
ExecStart = "${pkgs.bash}/bin/bash ${pkgs.writeScript "setup-keyboard.sh" ''
#!${pkgs.stdenv.shell}
@floscr
floscr / peerflix-hook.lua
Created December 30, 2019 16:52 — forked from ekisu/peerflix-hook.lua
A Lua user script for mpv that allows playing of magnet links, similar to the youtube-dl hook.
local utils = require 'mp.utils'
local msg = require 'mp.msg'
-- OPTIONS
local keep_file_after_streaming = true
local peerflix = {
path = "peerflix",
searched = false
}
@floscr
floscr / shell.nix
Created October 3, 2019 09:29
Ruby minor version issue
let
pkgs = import <nixpkgs> {}
{
inherit overlays;
};
# unstable = import (fetchTarball https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz) { };
stdenv = pkgs.stdenv;
ruby = pkgs.ruby_2_4;
rubygems = (pkgs.rubygems.override { ruby = ruby; });
@floscr
floscr / shell.nix
Created October 3, 2019 09:29
Ruby minor version issue
let
pkgs = import <nixpkgs> {}
{
inherit overlays;
};
# unstable = import (fetchTarball https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz) { };
stdenv = pkgs.stdenv;
ruby = pkgs.ruby_2_4;
rubygems = (pkgs.rubygems.override { ruby = ruby; });