Skip to content

Instantly share code, notes, and snippets.

View cdlm's full-sized avatar
💭
😴

Damien Pollet cdlm

💭
😴
View GitHub Profile
@cdlm
cdlm / # subversion - 2021-11-16_14-17-00.txt
Created November 16, 2021 13:18
subversion on macOS 12.0 - Homebrew build logs
Homebrew build logs for subversion on macOS 12.0
Build date: 2021-11-16 14:17:00
@cdlm
cdlm / headers
Last active September 10, 2020 09:39
Resolve C includes and header files.
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
function list-headers() {
local source="${1:--}"
cc -E -H "$source" 2>&1 1>/dev/null \
| sed '
# ignore recursive includes
@cdlm
cdlm / README.md
Last active May 16, 2020 10:58
Selectric II dual-pitch scale

Someone on Reddit asked for a picture

Metric ruler placed on the edge of the scale, for reference. Would probably be best to do a clean drawing of it in a vector format, but this seems fine for dimensions.

@cdlm
cdlm / new-image.sh
Last active January 15, 2018 18:29
Pharo image download/preparation script
#!/bin/bash
#
# Easier project setup for Pharo + Iceberg + Git.
#
# This script (re)downloads and prepares a ready-to-hack Pharo image, getting all
# necessary info from a small config file committed among the project's files.
#
set -euo pipefail
IFS=$'\n\t'
# ↑ bash strict mode http://redsymbol.net/articles/unofficial-bash-strict-mode/
@cdlm
cdlm / cycle.rs
Last active June 29, 2016 18:39
Evil things in Rust :]
#[derive(Debug)]
struct Foo { bar: *mut Bar }
#[derive(Debug)]
struct Bar { foo: *mut Foo }
#[cfg(test)]
mod tests {
use super::{Foo,Bar};
use std::ptr;
@cdlm
cdlm / lstsmalltalk.sty
Last active February 12, 2016 09:43
Smalltalk language for listings.sty with specific literate chevron for the method pattern. Not that useful in practice, unless all listings are single methods…
\ProvidesFile{lstsmalltalk.sty}
[2016/02/12 0.3 listings Smalltalk definitions file]
%
\RequirePackage{listings}
\RequirePackage{relsize}
\RequirePackage{calc}
\newcommand\language@smalltalk{smalltalk}
% all this needed to incept the above macro as the name of the language
@cdlm
cdlm / psych-wtf
Last active August 29, 2015 14:14
Psych loading WTF
$ gem list psych
*** LOCAL GEMS ***
psych (2.0.8)
$ ruby -r yaml -e 'puts Psych.methods.include?(:load_file)'
true
$ pry -r yaml
@cdlm
cdlm / README.md
Last active August 29, 2015 14:07
A puzzling wood joint…

A puzzling wood joint

First seen on Google +

Surprisingly, it took very little time to reverse-engineer it using Sketchup. The joint is symmetric around the diagonal of the cube it is inscribed into, and slides along that diagonal as well.

@cdlm
cdlm / README.md
Last active August 29, 2015 14:07
Scripts to help translating the Codeless Code (https://github.com/alessandro1997/the-codeless-code).

Helpers for translating the Codeless Code

The scripts are parameterized via environment variables (direnv), notably $CODELESS_TRANSLATION (see the help text in translate-case.rb).

  • translate-case.rb: automates the initial copy of cases from Qi's original version to a translation directory, and helps opening cases from a given translation.

  • pre-commit.rb: git hook to check for french spacing conventions (non-breaking spaces before double punctuation signs and inside quotes.

@cdlm
cdlm / test.ledger
Created April 21, 2014 22:39
Ledger accout alias heisenbug
# run several times using: ledger --strict -f test.ledger balance
# most of the time it works fine
# but sometimes the account aliases fail (e.g. ledger produces a warning "Unknown account 'tools'")
# heisenbug, follow-up at http://bugs.ledger-cli.org/show_bug.cgi?id=1022
commodity €
account expenses:tools
alias tools