Skip to content

Instantly share code, notes, and snippets.

@lf-araujo
lf-araujo / DZ.csv
Last active July 7, 2022 14:05
Datasets for testing mr-doc2.
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 8 columns, instead of 2 in line 7.
BMI1,SBP1,GVBMI1,GVSBP1,BMI2,SBP2,GVBMI2,GVSBP2
0.20450602349373012,0.15794185275913195,-0.6253460425789539,-1.4506357704541084,1.0368041873617186,2.3581301780775132,-0.8298045774825277,0.2977901609008576
0.02710841552909793,0.062340068970890866,1.165506516809426,2.5988269678085745,-0.7477862136123585,-0.039645920260557764,0.4720596468551339,1.121176751726064
-0.694968217893945,1.3316748984453453,-0.8845048916462366,-0.22485790797959493,-0.02986158818460549,2.1670362049186753,-0.7136479387220871,-1.1646095153104221
-0.46925474812234974,-1.5158469150202687,0.666265512952597,-0.2958073461218471,-1.3093263736540937,-3.185815004518587,1.848193553289432,-1.1532694234394503
-2.928643672028249,0.5173296570306684,-0.5450982105746571,1.494035128565943,-0.7657685814119848,0.3650675408550857,-0.9898203224153305,0.7430575670709684
-0.6822450262676277,-0.2730651897684174,-1.4524792824907986,-0.45730124749190254,-2.2362226201484505,-0.6163626791797621,0.04887399043839025,-0.6574261301364492
-0.45297495383569847,0.514131950
@lf-araujo
lf-araujo / init.vim
Created December 23, 2021 22:59
R IDE for R statistics, data analysis and a bit of Nim
This is the second version of my R as an IDE for stats using R. It is built on three tools: treesitter, lsp, and Nvim-R.
One has to manually run :TSInstall markdown, :TSInstall R, and :LspInstall R. Will update this with more time in the future
but the code is mostly self explaining:
```vimscript
" Installation {{{
call plug#begin(stdpath('data') . 'vimplug')
Plug 'EdenEast/nightfox.nvim'
Plug 'kristijanhusak/orgmode.nvim'
Plug 'scrooloose/nerdtree'
@lf-araujo
lf-araujo / r-ide.md
Last active July 16, 2024 12:05
Switching from Rstudio to Neovim

Neovim R-IDE

This is my init.vim to make a stable neovim installation act as a IDE for R statistical analyses (not too much for package development).

The settings are not using neovim-lsp, so expect this is a temporary solution until someone comes up with a complete lsp configuration for R.

Why?

@lf-araujo
lf-araujo / steam-de
Last active September 27, 2020 19:22
hdmi.sh
#!/bin/bash
# STEAM DE - Script for starting Steam at login
# Copyright (C) 2012 Thomaz de Oliveira dos Reis <thor27@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@lf-araujo
lf-araujo / Selenops.swift
Created September 20, 2018 12:44
A simple swift web crawler that look for a word of your choosing on the web, starting from a given webpage. Uses Swift, docopt and works on Linux.
/**
* Selenops
* Copyright (c) Federico Zanetello 2017
* Licensed under the MIT license. See LICENSE file.
*/
import Foundation
import Docopt // marathon: https://github.com/lf-araujo/docopt.swift.git
extension Collection where Indices.Iterator.Element == Index {
@lf-araujo
lf-araujo / 2018-06-28-gestures.md
Last active April 30, 2019 13:25
Reactivating gestures after hibernate

Reactivating gestures after hibernate

This is a super quick note on how to reactivate touchpad gestures in Archlinux distributions after hibernation if you use libinput-gestures.

Open you editor, add the following content:

[Unit]
Description=Restart gestures
@lf-araujo
lf-araujo / 2018-01-05-R-REPL.md
Last active August 15, 2019 20:11
R REPL with Sublime Text 3

R REPL with Sublime Text 3

Sublime Text is a closed source expansible text editor, which I use for several tasks. I have shown how to use it as a processor for technical texts, a Read Eval Print Loop (REPL) for the Swift Programming Language. Below I will explain how to do the latter with R as well.

Install Sublime Text REPL add-on

Launch the command palette, with Ctrl + Shift + P and type Install Packages. Now search for SublimeREPL and install it.

@lf-araujo
lf-araujo / 2017-12-11-swift.md
Last active March 31, 2019 10:35
Building a Swift Project in SublimeText

Building a Swift Project in SublimeText

Sublimetext is an expansible document editor that I use for most of my projects. It can become a complete IDE, provided one installs extensions to it. Here is a way of building Swift Programming Language projects with it.

In Tools > Building System > New Building System one can create new building instructions. Paste the following:

{
"cmd": ["swift","build"],
"working_dir":"${project_path:${folder}}",
@lf-araujo
lf-araujo / 2017-10-17-serving.md
Last active March 31, 2019 10:39
Collaborating and Serving Pandoc via Dropbox

It is possible to keep working in a pandoc project even if one is away from the computer. It is even better if this also allows for remote collaboration. There is a hackish way of doing that, of course mighy_make is essential part for the workflow. The below instructions will allow you to copy a markdown text into your Dropbox, which will trigger GNUMake to process the source and generate the output (pdf, epub, Word), which can be then on forwarded. The steps are:

  1. Create a directory in your dropbox folder (I name it mighty_make) and cd into it
  2. Download mighty_make with: wget http://tiny.cc/mighty_test -O Makefile
  3. Prepare the folder structure with make prepare
  4. Optional (for collaboration): Log into your dropbox account and share the directory with your collaborator

Now you need to set the server up, meaning go to the computer in your household that stays online the longer (must be Linux or Mac) and set up a crontab rule. This is done with the command crontab -e and add the followi

@lf-araujo
lf-araujo / 2017-09-17-acronym.md
Last active March 31, 2019 10:39
Acronyms Addon for Mighty_Make

In large documents it is often useful to have a page reserved for the list of acronyms. I've tried several approaches to this and after a discussion at pandoc-discuss the following solution was suggested. The author suggested the use of the package acronyms, but I found it easier to work with the package acro.

It will look like:

![]( /images/Captura de tela de 2017-12-26 20-22-44.png )

This solution comes in the form of a mighty_make theme. The steps to get this going is to download mighty_make's testing branch: