Skip to content

Instantly share code, notes, and snippets.

View carlocorradini's full-sized avatar
🎯
Focusing

Carlo Corradini carlocorradini

🎯
Focusing
View GitHub Profile
@joehillen
joehillen / build.sh
Last active January 24, 2025 22:05
Build bash scripts with `source` files into a single script.
#!/usr/bin/env bash
#
# https://gist.github.com/joehillen/30f08738c1c3c0ca3e4c754ad33ad2ff
#
# This script inlines 'source' files.
#
# For long scripts, it is nice to be able to break them into multiple files
# to make them easier to work with but still release as a single script.
#
# Inspired by https://stackoverflow.com/a/37533160/334632 with the following enhancements:
@mstolin
mstolin / example.csv
Created July 24, 2022 14:03
CloudFree Plug Power Consumption monitor
Time Total Today Power Voltage Current
2022-07-24T15:03:02 0.037 0.037 40 227 0.282
2022-07-24T15:03:07 0.037 0.037 39 227 0.282
2022-07-24T15:03:12 0.037 0.037 38 227 0.283
@rokups
rokups / CMakeLists.txt
Last active March 26, 2025 03:00
Dear ImGui CMake build script.
#
# CMake build system for Dear ImGui
# =================================
#
# Build instructions:
# 1. Install latest CMake
# * Windows: https://cmake.org/download/ (Tick checkbox to place cmake in system PATH)
# * Linux: from your favorite package manager
# * MacOS: brew install cmake
# 2. Open command prompt in directory containing "imgui" and "imgui_dev" folders
@cristianadam
cristianadam / bundle_static_library.cmake
Created January 17, 2020 00:30
CMake function which bundles multiple static libraries into one
# MIT License
#
# Copyright (c) 2019 Cristian Adam
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@akutz
akutz / README.md
Last active August 29, 2024 10:28
Comparing semantic version strings in POSIX shell

Overview

The attached script provides a function for comparing semantic versions in a POSIX shell script.

Result Description
-1 A<B
0 A=B
1 A>B

Usage

\documentclass{article}
\usepackage[dvipsnames]{xcolor} % https://en.wikibooks.org/wiki/LaTeX/Colors
\definecolor{LightGray}{rgb}{0.97,0.97,0.97}
\usepackage{listings} % syntax highlighting
\lstdefinelanguage{SPARQL}{
basicstyle=\small\ttfamily,
backgroundcolor=\color{LightGray},
columns=fullflexible,
breaklines=false,
#!/sbin/openrc-run
description="node_exporter"
: ${NODE_PIDFILE:=/var/run/node_exporter.pid}
: ${NODE_USER:=root}
depend() {
need net
need localmount
@galexrt
galexrt / node_exporter.sh
Last active October 28, 2024 15:26
Simple Prometheus node_exporter install script (Updated for 1.0.1)
#!/bin/bash
version="${VERSION:-1.0.1}"
arch="${ARCH:-linux-amd64}"
bin_dir="${BIN_DIR:-/usr/local/bin}"
wget "https://github.com/prometheus/node_exporter/releases/download/v$version/node_exporter-$version.$arch.tar.gz" \
-O /tmp/node_exporter.tar.gz
mkdir -p /tmp/node_exporter

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment