Skip to content

Instantly share code, notes, and snippets.

@lf-araujo
lf-araujo / rc.xml
Created February 20, 2026 13:57
Labwc config
<?xml version="1.0"?>
<labwc_config>
<core>
<gap>5</gap>
</core>
<theme>
<name>OpenboxSur-Dark</name>
<cornerRadius>8</cornerRadius>
<font name="sans" size="10"/>
@lf-araujo
lf-araujo / lsfz.sh
Last active February 19, 2026 17:04
Gnome tracker search command line tool
#!/usr/bin/env bash
# lsfz: LocalSearch + fzf with compact labels and Enter-to-open
# Deps: localsearch, fzf, gio (or xdg-open), bash
set -euo pipefail
# How many results to fetch
LIMIT="${LIMIT:-200}"
# What to search (e.g. --files | --documents | --images)
@lf-araujo
lf-araujo / ml.nim
Last active February 19, 2026 16:16
# npsol.nim
# Compile & run:
# nim c -r -d:release -d:opencl -d:blas=openblas --mm:refc npsol.nim
import std/[math, strformat, sequtils, os]
import arraymancer
import arraymancer/tensor/tensor_opencl
import arraymancer/tensor/backend/opencl_backend
import numericalnim
import opencl
import datamancer
@lf-araujo
lf-araujo / map_chunk.R
Created January 17, 2025 15:07
Future map with OpenMx in simulations
library(purrr)
library(dplyr)
library(future)
library(progress)
# Set up parallel processing
plan(multicore, workers = 23)
# Define the parameters
params <- list(
@lf-araujo
lf-araujo / style.theme
Created March 2, 2024 23:04
Report theme for emacs export
#+OPTIONS: org-html-head-include-default-style:nil
#+OPTIONS: num:nil
#+OPTIONS: html-style:nil
#+OPTIONS: html-scripts:nil
#+OPTIONS: html-postamble:nil
#+OPTIONS: broken-links:mark
#+HTML_HEAD: <style type="text/css">
#+HTML_HEAD: @charset "utf-8";
#+HTML_HEAD: @import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500');
#+HTML_HEAD: @import url('https://fonts.googleapis.com/css?family=Roboto Slab:300,400,500');
html,button,input,select,textarea { color: #484C66;}html { font-size: 90%; line-height: 1.4;}*,*:before,*:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}a { white-space: pre; white-space: pre-wrap; white-space: pre-line; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: -moz-pre-wrap; white-space: -hp-pre-wrap; word-wrap: break-word; text-decoration: none;}a:hover { color: #0A4C89;}/* * Remove text-shadow in selection highlight: h5bp.com/i * These selection rule sets have to be separate. * Customize the background color to match your design. */::-moz-selection { background: #0A4C89; color: #FFF; text-shadow: none;}::selection { background: #0A4C89; color: #FFF; text-shadow: none;}/* * A better looking default horizontal rule */hr { display: block; height: 1px; border: 0; border-top: 1px dashed #CCC; margin: 1em 0; padding: 0;}/* * Remove the gap between images, videos, audio and canvas and the bottom of * their containers:
@lf-araujo
lf-araujo / non-pos def.md
Created December 7, 2022 16:55
Correcting non-positive definite matrices and misspecification related to starting values

Correcting non-positive definite matrices and misspecification related to starting values

In OpenMx, as model complexity grows, the higher the chance of not setting starting values that will help the optimizer reach a solution. This is particularly true for longitudinal models. This post aims at defining a set of rules that can help you define good starting points and also present what is current available. Starting values can lead to time-consuming, annoying errors and thinking about them during model

@lf-araujo
lf-araujo / warp-no-more.md
Last active September 28, 2022 18:37
Wrap no more

Wrap no more

The ggplot2 plus syntax is a much better fit for what I was attempting. For model building, summing models makes more sense than piping them. And also, the code needed to implement this is much shorter. So for something like:

mb <- mxModel("bivariate Heterogeneity Path Specification", 
    type = "RAM",
    manifestVars = c('X','Y')) +
    mxPath( from=c('X','Y'), arrows=2, free=T, values=1, lbound=.01 ) +
@lf-araujo
lf-araujo / lunarvim.md
Created July 17, 2022 14:31
Lunarvim settings for R and Nim

Lunarvim R-IDE

Lunarvim settings for R statistics with neovim as an IDE.

--[[
lvim is the global options object

Linters should be
@lf-araujo
lf-araujo / wrap.md
Last active August 17, 2022 13:30
Mx.wrap(): Using R-base pipes to create OpenMx models

Mx.wrap(): Using R-base pipes to create OpenMx models

TLDR: Create OpenMx models using pipes.

Pipes (|) were introduced in bash in order to facilitate I/O redirection. Together with the UNIX tools, manipulation of data becomes very simple and short to write. In R the concept of the pipe came much more recently, with the magrittr package within the context of dplyr and tidy tools manifesto. One fundamental decision was to name the dplyr tools so that they can be read as verbs, which helps with memorizing what each tool does, in contrast to the less obvious naming of the UNIX tools.