Skip to content

Instantly share code, notes, and snippets.

View fidergo-stephane-gourichon's full-sized avatar

Stéphane Gourichon fidergo-stephane-gourichon

View GitHub Profile
@fidergo-stephane-gourichon
fidergo-stephane-gourichon / .gitconfig
Created November 23, 2018 16:01
A sample .gitconfig file.
[core]
editor = edite
[user]
name = FIXME put your name here, to be included into each commit
email = FIXME put your e-mail address here, to be included into each commit
[color]
ui = auto
[alias]
st = status
[merge]
@fidergo-stephane-gourichon
fidergo-stephane-gourichon / git_path_to_github_url.sh
Last active August 14, 2019 15:45
This bash script will transform a relative or absolute path to file or dir into a github URL you can browse and share.
#!/bin/bash
# Transform a relative or absolute path to file or dir into a github URL you can browse and share.
#
# usage: git_path_to_github_url.sh -
# usage: git_path_to_github_url.sh somedir/somefile
for ENTRY
do
(
echo {} /* >/dev/null SG\MARKER\VERY\IMPROBABLE\STRING\MY\START
# This file is both a valid CSS style sheet,
# and a valid bash script.
# It adjusts your main Firefox profile so that github and all the
# stackexchange websites do not artifically limit main area width.
# Hooray! No more clobbered listings!
# More technically, it configures and enables userContent.css. It
@fidergo-stephane-gourichon
fidergo-stephane-gourichon / test_xfconf_keys.sh
Created January 1, 2020 09:54
Bug in xfconf-query regarding setting keys shortcuts?
# Let's query some keyboard shortcut
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Alt><Shift>Tab' ; echo $?
cycle_reverse_windows_key
0
# So far so good.
# Let's remove that shortcut.
# Build log
# Precompiled toolchain
Binaries from https://github.com/im-tomu/fomu-toolchain/releases/download/v1.5.3/fomu-toolchain-linux_x86_64-v1.5.3.tar.gz
ld: libm.a(lib_a-sf_expm1.o): in function `.L0 ':
sf_expm1.c:(.text+0x4e0): undefined reference to `__math_oflowf'
@fidergo-stephane-gourichon
fidergo-stephane-gourichon / gist:049156c7856477f44ddfe58fc97d7def
Created January 28, 2020 15:19
Wishbone Tool 0.6.7 FOMU reset log.
git remote -v show
origin https://github.com/litex-hub/wishbone-utils (fetch)
origin https://github.com/litex-hub/wishbone-utils (push)
git describe
v0.6.7
RUST_LOG=debug wishbone-tool --version
@fidergo-stephane-gourichon
fidergo-stephane-gourichon / dec18.py
Last active December 19, 2020 20:01
Advent of code, step 1: an unusual math context where operators have no priority!
#!/usr/bin/env python3
import itertools
from enum import Enum, auto
import re
import logging
import sys
import numbers
logging.basicConfig(level=logging.INFO, stream=sys.stderr)
@fidergo-stephane-gourichon
fidergo-stephane-gourichon / self_referencing_construct_with_deep_self_references.c
Created July 2, 2023 19:46
In C, compile time constant structs and array with deep self-reference.
/* Summary: In C, compile time constant structs and array with deep self-references.
** Context: const and compile-time constants
Constructs fully determined at compile time have some benefits.
But const in C is weaker than constexpr that C++ has.
As prog-fh summarizes on
https://stackoverflow.com/questions/66144082/why-does-gcc-clang-handle-code-slightly-differently-example-given