Skip to content

Instantly share code, notes, and snippets.

View TypedLambda's full-sized avatar

Arne Ehrlich TypedLambda

View GitHub Profile
@TypedLambda
TypedLambda / makefile.targets
Created November 16, 2022 13:19
compile_commands.json generation for eclipse cdt / mcuxpresso build
# use 'compiledb' to create a 'compile_commands.json'
ifneq (,$(shell which compiledb 2>&1))
compile_commands.json: | ${C_SRCS}
${MAKE} -Bnwk build-only | sed -e 's#\\#\\\\\\\\#g' -e "s#'\"\\([^']*\\)\"'#\"\\\\\"\1\\\\\"\"#g" | compiledb -o $@
# hook into post build
post-build: | compile_commands.json
endif
@TypedLambda
TypedLambda / makefile.targets
Last active December 7, 2022 13:32
make clean fix for eclipse / mcuxpreso projects with generated makefiles
## section only for 'clean' target
# CDT's generated makefile contains a clean target containing so many files, it can't be executed on windows
# this is a workaround to invoke a per file delete instead, without the need to switch to writing the makefiles
# manualy.
# if make is called with 'clean' as the first argument, prepare some special workaround to limit command line length
ifeq (clean,$(firstword $(MAKECMDGOALS)))
defmodule Acme.Repo do
use Ecto.Repo,
otp_app: :acme,
adapter: Ecto.Adapters.Postgres
def with_prefix(prefix) do
module_atom = Module.concat([Acme, Repo, WithPrefix, Macro.camelize(prefix)])
# We could not find a better way to see if this module already existed
if !Kernel.function_exported?(module_atom, :prefix, 0) do
@TypedLambda
TypedLambda / tardis.sql
Last active October 1, 2023 18:28 — forked from iperdomo/tardis.sql
-- psql -U postgres -h localhost -f /path/to/tardis.sql
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
@TypedLambda
TypedLambda / freebsd_upgrade_11.0-11.1-abridged
Created January 31, 2018 08:16
Abridged upgrading work VM from FreeBSD 11.0-RELEASE to FreeBSD 11.1-RELEASE with Boot Environments
bil@fbsd-bil:~ %>su -
Password:
root@fbsd-bil:~ # beadm create 11.1-RELEASE
Created successfully
root@fbsd-bil:~ # beadm mount 11.1-RELEASE /mnt
Mounted successfully on '/mnt'
root@fbsd-bil:~ # freebsd-update upgrade -b /mnt -r 11.1-RELEASE