This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <errno.h> | |
| #include <libproc.h> | |
| int main(int argc, char* argv[]) | |
| { | |
| pid_t pid; | |
| int ret; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| # http://ifcuriousthenlearn.com/blog/2015/06/18/center-of-mass/ | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D | |
| #set plot sizes | |
| plt.rcParams['figure.figsize'] = (10, 2) # (width, height) | |
| plt.rcParams['font.size'] = 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| import decimal | |
| import re | |
| import math | |
| import readline | |
| RED = "\033[0;31m" | |
| LIGHT_GREEN = "\033[1;32m" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| useage() { | |
| printf "\n\e[1;4mAscii Escape Code Helper Utility\e[m\n\n" | |
| printf " \e[1mUseage:\e[m colors.sh [-|-b|-f|-bq|-fq|-?|?] [start] [end] [step]\n\n" | |
| printf "The values for the first parameter may be one of the following:\n\n" | |
| printf " \e[1m-\e[m Will result in the default output.\n" | |
| printf " \e[1m-b\e[m This will display the 8 color version of this chart.\n" | |
| printf " \e[1m-f\e[m This will display the 256 color version of this chart using foreground colors.\n" | |
| printf " \e[1m-q\e[m This will display the 256 color version of this chart without the extra text.\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| """ | |
| set file atime and ctime based on the date pattern YYYY[_-]MM[_-]DD in filename | |
| """ | |
| import argparse | |
| import re | |
| import os | |
| import datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // démonstration emplace c++11 vs. c++17 | |
| // rene-d 2019 | |
| //#include <bits/stdc++.h> | |
| #include <iostream> | |
| #include <vector> | |
| #include <unordered_map> | |
| using namespace std; | |
| struct toto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Docker image downloader | |
| # download Docker images without Docker installed | |
| FROM docker:edge | |
| RUN apk add --no-cache bash curl ca-certificates jq go | |
| ADD https://raw.githubusercontent.com/moby/moby/master/contrib/download-frozen-image-v2.sh /bin/download-frozen-image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM alpine AS builder | |
| RUN apk add gcc musl-dev glib-static glib-dev upx | |
| COPY a.c / | |
| RUN gcc a.c `pkg-config --cflags --libs glib-2.0` -static \ | |
| && strip a.out \ | |
| && upx -q a.out || true | |
| FROM scratch | |
| COPY --from=builder /a.out / | |
| ENTRYPOINT ["/a.out"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.7) | |
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | |
| set(CMAKE_VERBOSE_MAKEFILE ON) | |
| string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type) | |
| message("AAA CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE} ${cmake_build_type}") | |
| if (cmake_build_type STREQUAL "debug") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| """ | |
| télécharge les exemples de https://edupython.tuxfamily.org | |
| """ | |
| import requests | |
| import re | |
| import pathlib | |
| # import black |