Skip to content

Instantly share code, notes, and snippets.

@rcarmo
rcarmo / tiling.js
Created June 7, 2021 15:34
Phoenix tiling snippet
// Stub of my .phoenix.js with basic XMonad-like tiling
// Amethyst bindings
Key.on("return", ["shift", "control", "option"], () => tile_windows(WEST));
Key.on("return", ["shift", "control"], () => retile());
Key.on("j", ["shift", "control"], () => rotate(-1, false));
Key.on("j", ["shift", "control", "option"], () => rotate(-1, true));
Key.on("k", ["shift", "control"], () => rotate(1, false));
Key.on("k", ["shift", "control", "option"], () => rotate(1, true));
@rcarmo
rcarmo / font_organizer.py
Last active May 31, 2021 18:22
TrueType Font Organizer
from contextlib import redirect_stderr
from itertools import chain
from os import makedirs
from os.path import exists, join
from pathlib import Path
from shutil import move
from typing import Generator
from fontTools import ttLib # also requires brotli for some font formats
@rcarmo
rcarmo / roundedcube.scad
Created April 7, 2021 21:30 — forked from groovenectar/roundedcube.scad
roundedcube.scad - Fork me and make me better!
// More information: https://danielupshaw.com/openscad-rounded-corners/
// License 2020-08-13: The only three people in this world who are allowed to use roundedcube.scad are named Dan Upshaw, Dan Fandrich, and @drohhyn
// Set to 0.01 for higher definition curves (renders slower)
$fs = 0.15;
module roundedcube(size = [1, 1, 1], center = false, radius = 0.5, apply_to = "all") {
// If single value, convert to [x, y, z] vector
size = (size[0] == undef) ? [size, size, size] : size;
@rcarmo
rcarmo / multi-arch-docker-ci.sh
Created March 29, 2021 21:49 — forked from ArturKlauser/multi-arch-docker-ci.sh
Building Multi-Architecture Docker Images With Buildx
#!/bin/bash
# (c) [email protected]
#
# This script installs support for building multi-architecture docker images
# with docker buildx on CI/CD pipelines like Github Actions or Travis. It is
# assumed that you start of with a fresh VM every time you run this and have to
# install everything necessary to support 'docker buildx build' from scratch.
#
# Example usage in Travis stage:
#
@rcarmo
rcarmo / godot.md
Created December 6, 2020 15:34 — forked from malduarte/godot.md
godot build instructions for raspberry PI 4

Install dependencies

sudo apt install build-essential scons clang pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libudev-dev libxi-dev libxrandr-dev yasm

Checkout godot

git clone https://github.com/godotengine/godot.git cd godot

checkout supported version

git checkout 3.2.3-stable

build (don't hold your breath, this will take over 30m)

@rcarmo
rcarmo / howto-migratePSTintoThunderbird.txt
Created October 20, 2020 18:57 — forked from cubapp/howto-migratePSTintoThunderbird.txt
Migrate from Outlook PST to Thunderbird
Terminal:
sudo apt install pst-utils
mkdir migrated-emails
readpst -o ./migrated-emails -M -u -w -e -b outlook.pst
Thunderbird:
1. install "ImportExportTools NG" add on
2. make new folder "MigratedEmails" in Thunderbird - preferably in "Lofal Folders"
3. right click on MigratedEmails folder -> ImportExportTools NG
-> import all messages from a directory
@rcarmo
rcarmo / build_node9.sh
Created October 13, 2020 21:13 — forked from hnakamur/build_node9.sh
get and build node9
#!/bin/sh
set -e
basedir=`pwd`
mkdir -p "$basedir/github.com/jvburnes"
git clone https://github.com/jvburnes/node9 "$basedir/github.com/jvburnes/node9"
mkdir -p "$basedir/github.com/stevedonovan"
git clone https://github.com/stevedonovan/Penlight "$basedir/github.com/stevedonovan/Penlight"
@rcarmo
rcarmo / app.fnl
Created September 6, 2020 17:09 — forked from turbo/app.fnl
; vi: ft=clojure
; THIS IS A Fennel SOURCE FILE (.fnl) !NOT! clojure!
; you need to use luajit to run this, after using fennel --compile
; install lapis and turbo from luarocks
; When running with Fennel directly, you need to --globals all used HTML tags
(local turbo (require "turbo"))
(local render_html (. (assert (require "lapis.html")) :render_html))
@rcarmo
rcarmo / raspberry-pi-zero_as_webcam.md
Created August 26, 2020 14:14 — forked from justinschuldt/raspberry-pi-zero_as_webcam.md
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
@rcarmo
rcarmo / Makefile
Last active April 20, 2020 10:57
Setup shairport-sync on a Raspberry Pi
deps:
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get autoremove -y
sudo apt-get install -y \
build-essential git autoconf automake libtool \
xmltoman libdaemon-dev libpopt-dev libconfig-dev \
libasound2-dev libpulse-dev \
avahi-daemon libavahi-client-dev \
libssl-dev libsoxr-dev \