Skip to content

Instantly share code, notes, and snippets.

View CGuichard's full-sized avatar
🐺

Clément GUICHARD CGuichard

🐺
  • CS Group
  • Toulouse, France
View GitHub Profile
@CGuichard
CGuichard / python-str-formatting.md
Last active February 19, 2024 16:31
Python: String formatting

Python: String formatting

In every language, text formatting is an important feature. Almost every language has a specific way to deal with it. So here's a little tutorial/reminder on how to do string formatting in Python.

Note: I'm using Python 3.8 in the examples.

Let's go

Addition & cast

@CGuichard
CGuichard / inheritance.py
Created June 26, 2022 12:59
Python method which dynamically adds inheritance
# -*- coding: utf-8 -*-
"""Dynamically adds inheritance.
Contains the `inherit` method, which dynamically
adds inheritance from a parent object to a child object.
"""
import inspect
@CGuichard
CGuichard / ply2obj.py
Last active January 20, 2023 01:23 — forked from Helias/ply2obj.py
Python script to convert *.ply to *.obj (3D formats)
import os
from argparse import ArgumentParser
from os import listdir
from os.path import isfile, join
from plyfile import PlyData
def parse_args():
parser = ArgumentParser()
@CGuichard
CGuichard / strdup.c
Created October 21, 2021 22:19
Implementation of the strdup function in C
/**
* @file strdup.c
* @author CGuichard
* @standard C99
* @version 1.0
* @date 22th October 2021
*
* @brief Implementation of the strdup function in C
*
* This file implements the function strdup in C. As the name implies,
@CGuichard
CGuichard / Makefile
Created March 14, 2021 23:37
Self-documented Makefile
##@ Welcome, this Makefile is an example of self-documented
##@ Makefile. Here are the features:
##@ - Add "##@" followed by a text to write the Makefile header text.
##@ You can also write the Makefile header inside a MAKEFILE_HELP variable.
##@ The last way is to write a Makefile.help file inside the same folder.
##@ - Add "##" next to one of the Makefile's target to document it.
.PHONY: default run
# ======================================================= #
@CGuichard
CGuichard / bulma-extensions.md
Last active September 13, 2022 04:28
Bulma extensions list. Don't waste time searching.

Bulma extensions

Intro

Choosing a CSS framework can be a hassle. Some people choose to stick to Bootstrap, but sometimes changing is good. One of the alternatives that I love is Bulma.

Bulma is 100% CSS only, no Javascript, light-weight and beautiful. The lack of Javascript is frustrating in some cases, like the tabs. To overcome this problem, you can check BulmaJS. It is an unofficial extension, but it's great.

But one of its weakness is its simplicity. Some fabulous Bootstrap components like the Carousel are missing. To add such features, you can use one or more extension for Bulma.