commit 27d59dc3bcf9f45c147412fdf82b2e3a3d0acd0b Author: _N3m0 Date: Wed Feb 1 19:08:43 2023 +0100 premier commit diff --git a/completion b/completion new file mode 100644 index 0000000..069f2a3 --- /dev/null +++ b/completion @@ -0,0 +1,22 @@ +#!/bin/bash + +cmpt_mcm(){ + for opt in `ls --ignore=*.jar ~/.minecraft/mods`; do + COMPREPLY+=("$opt") + done +} +complete -F cmpt_mcm mcm + +cmpt_newp(){ + for opt in `ls ~/dev/script/newp-template`; do + COMPREPLY+=("${opt%.*}") + done +} +complete -F cmpt_newp newp + +cmpt_prj(){ + for opt in `ls ~/dev`; do + COMPREPLY+=("$opt") + done +} +complete -F cmpt_prj prj diff --git a/cpl b/cpl new file mode 100755 index 0000000..147038a --- /dev/null +++ b/cpl @@ -0,0 +1,35 @@ +#!/bin/bash + +if [[ $1 != "" ]]; then + cd $1 2>/dev/null +fi + +if [ $(ls CMakeLists.txt 2>/dev/null) ]; then # cpp + project=$(grep "^\(project(\)" CMakeLists.txt) || exit + project=${project#project(} + project=${project%% *} + cd build + cmake -DCMAKE_BUILD_TYPE=Debug .. + make + ./$project +elif [[ ${1##*.} = "py" ]]; then # py + python3 $1 +elif [ $(ls *.gpr 2>/dev/null) ]; then # ada + gprbuild $(ls *.gpr) && echo -e "\nexecutable :" && ls -F obj | grep "*$" +elif [[ ${1##*.} = "sh" ]]; then # bash + chmod +x $1 +elif [ $(ls .webconfig 2>/dev/null) ]; then # web + rm -rf dst/.files + name=$(grep name .webconfig) + name=${name##* } + link=$(grep link .webconfig) + link=${link##* } + ssg src dst "$name" "$link" +elif [ $(find -name "*.java" | wc -l) -ge 1 ]; then # java + find -name "*.java" > .files + javac -cp lib/*.jar -d build/ @.files + name=$(pwd) + name=${name##*/} + cd build + java $name +fi diff --git a/lol b/lol new file mode 100755 index 0000000..f3c9ed4 --- /dev/null +++ b/lol @@ -0,0 +1,7 @@ +#!/bin/bash + +if [[ $1 = "" ]]; then + fortune | cowsay -f tux | lolcat +else + cowsay -f tux $1 | lolcat +fi diff --git a/mcm b/mcm new file mode 100755 index 0000000..6986f13 --- /dev/null +++ b/mcm @@ -0,0 +1,15 @@ +#!/bin/bash + + +load=$1 +cd ~/.minecraft/mods + +for modpack in `ls --ignore=*.jar`; do + if [ $(ls $modpack | wc -l) -eq 0 ]; then + mv *.jar $modpack + fi +done + +if [[ $load != "" ]]; then + mv $load/*.jar . +fi diff --git a/newp b/newp new file mode 100755 index 0000000..964dc91 --- /dev/null +++ b/newp @@ -0,0 +1,28 @@ +#!/bin/bash + +case $1 in + sh) cp ~/dev/script/newp-template/sh.template $2 ;; + cpp) cp -r ~/dev/script/newp-template/cpp.template $2 + cd $2 + touch CMakeLists.temp + name=${2##*/} + sed "s/^\(project(cpp.template\)/project($name/" CMakeLists.txt > CMakeLists.temp + cat CMakeLists.temp > CMakeLists.txt + rm CMakeLists.temp + echo $2 > .wakatime-project;; + web) cp -r ~/dev/script/newp-template/web.template $2 + cd $2 + echo "name : $2" > .webconfig + if [[ $3 != "" ]]; then + echo "link : $3" >> .webconfig + else + echo "link : http://www" >> .webconfig + fi + echo $2 > .wakatime-project;; + java) cp -r ~/dev/script/newp-template/java.template $2 + cd $2 + touch src/$2.java + sed "s/template/$2/" src/template.java > src/$2.java + rm src/template.java + echo $2 > .wakatime-project;; +esac diff --git a/newp-template/cpp.template/CMakeLists.txt b/newp-template/cpp.template/CMakeLists.txt new file mode 100644 index 0000000..f9007ec --- /dev/null +++ b/newp-template/cpp.template/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.10) + +# Project +project(cpp.template LANGUAGES CXX) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_EXTENSIONS off) +set(CMAKE_CXX_FLAGS "-Wall -Weffc++ -Wextra -Wsign-conversion") + +# Sources +file(GLOB_RECURSE SOURCES src/*.cpp) +file(GLOB_RECURSE HEADERS includes/*.hpp includes/*.h src/*.hpp src/*.h) + +# ex librairie +# find_package(exlib REQUIRED) # ou QUIET (req = obligée, si erreur stop ; quiet = si erreur, informe et continue) +# include_directories(${exlib_INCLUDE_DIRS}) # optionnel, si erreur chercher exlibCONFIG.cmake pour trouver le $() qui convient +# link_directories(${exlib_LIB_DIRS}) # optionnel; pareil qu'en dessus +# add_definitions(${exlib_FLAGS}) + +# Executable +add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS}) + +# suite exlib +# target_link_libraries(${PROJECT_NAME} ${exlib_LIBRARIES}) + +# Includes +target_include_directories(${PROJECT_NAME} PUBLIC includes) +target_include_directories(${PROJECT_NAME} PUBLIC src) + +# tuto +# https://www.youtube.com/watch?v=9fowTjLimxQ tuto cmake +# https://www.youtube.com/watch?v=Lrt3i83wsy4 tuto cmake lib diff --git a/newp-template/cpp.template/src/main.cpp b/newp-template/cpp.template/src/main.cpp new file mode 100644 index 0000000..6fadfc2 --- /dev/null +++ b/newp-template/cpp.template/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(){ + std::cout << "Hello World!" << std::endl; + return 0; +} diff --git a/newp-template/java.template/.files b/newp-template/java.template/.files new file mode 100644 index 0000000..e69de29 diff --git a/newp-template/java.template/src/template.java b/newp-template/java.template/src/template.java new file mode 100644 index 0000000..3170e00 --- /dev/null +++ b/newp-template/java.template/src/template.java @@ -0,0 +1,6 @@ +public class template{ + + public static void main(String [] args){ + System.out.println("Hello world!"); + } +} diff --git a/newp-template/sh.template b/newp-template/sh.template new file mode 100755 index 0000000..44e9a4e --- /dev/null +++ b/newp-template/sh.template @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello Bash" diff --git a/newp-template/web.template/.webconfig b/newp-template/web.template/.webconfig new file mode 100644 index 0000000..be97b7c --- /dev/null +++ b/newp-template/web.template/.webconfig @@ -0,0 +1,2 @@ +name : +link : diff --git a/newp-template/web.template/src/_footer.html b/newp-template/web.template/src/_footer.html new file mode 100644 index 0000000..308b1d0 --- /dev/null +++ b/newp-template/web.template/src/_footer.html @@ -0,0 +1,2 @@ + + diff --git a/newp-template/web.template/src/_header.html b/newp-template/web.template/src/_header.html new file mode 100644 index 0000000..e864f82 --- /dev/null +++ b/newp-template/web.template/src/_header.html @@ -0,0 +1,11 @@ + + + + + + + diff --git a/newp-template/web.template/src/accueil.md b/newp-template/web.template/src/accueil.md new file mode 100644 index 0000000..cd2fe54 --- /dev/null +++ b/newp-template/web.template/src/accueil.md @@ -0,0 +1,3 @@ +--- +# Accueil +--- diff --git a/newp-template/web.template/src/article.md b/newp-template/web.template/src/article.md new file mode 100644 index 0000000..25b0bce --- /dev/null +++ b/newp-template/web.template/src/article.md @@ -0,0 +1,7 @@ +--- +# Article +--- + ++ *10 janv 2023* - [MD Test](mdtest.html) ++ *10 janv 2023* - [Article](article.html) ++ *10 janv 2023* - [Accueil](accueil.html) diff --git a/newp-template/web.template/src/img/logo.png b/newp-template/web.template/src/img/logo.png new file mode 100644 index 0000000..d996865 Binary files /dev/null and b/newp-template/web.template/src/img/logo.png differ diff --git a/newp-template/web.template/src/img/whyareyougay.jpg b/newp-template/web.template/src/img/whyareyougay.jpg new file mode 100644 index 0000000..baa181e Binary files /dev/null and b/newp-template/web.template/src/img/whyareyougay.jpg differ diff --git a/newp-template/web.template/src/mdtest.md b/newp-template/web.template/src/mdtest.md new file mode 100644 index 0000000..03194b7 --- /dev/null +++ b/newp-template/web.template/src/mdtest.md @@ -0,0 +1,81 @@ +--- + +# Markdown Template + +--- + +[link to menu](menu.html) + +### debut + +Les paragraphes sont separrées par des ligne vides, +**le texte en gras** est entouré par deux astérix, +*le texte en italique* est entouré par un astérix, +et ~~le barré~~ et entouré par deu vague (~). + +pour sauté une ligne +il faut deux espace a la fin de la linge. + +[un lien](https://www.youtube.com/watch?v=dQw4w9WgXcQ). + +![une image](img/whyareyougay.jpg) + +le ! permet d'afficher l'image + +[un autre lien](hihiha "avec un petit texte") + +| je | suis | 1 | +|------|---------|---| +| un | tableau | 2 | +| hihi | ha | 3 | + +--- + +| 0 | / | hihiha | +|:--|-------------|--------------------------------------------------------------------------------:| +| 1 | information | je suis un information tres crucial car j'aime le zizi surtou le fromage autour | +| 2 | description | neamoins j'aime aussi les carte graphique, sa croustille sous la dents | + +un peut de code : + + #include + + int main(){ + std::cout << "hamood is sus!" << std::endl; + return 0; + } +encore un peut plus + + $ fortune | cowsay -f tux | lolcat + +voici de sage parole + +> je suis une citation + +ou peut etre pas + +> eh ouais ma geueule + +ou bien les pieds + +> hihiha + ++ une ++ liste + - rien + - de + + normal + - plus ++ classique + +1. a +1. moins +1. que + +tu prefere + +42. celle +1. ci + + ou + + celle +1. la diff --git a/newp-template/web.template/src/style.css b/newp-template/web.template/src/style.css new file mode 100644 index 0000000..ac98cb1 --- /dev/null +++ b/newp-template/web.template/src/style.css @@ -0,0 +1,73 @@ +body{ + max-width: 800px; + margin: auto; + + background-color: #000000; + color: #cccccc; + + font-size: 1.3rem; + font-family: arial; + +} +a{ + color: #ffddaa; +} +a:visited{ + color: #bbaa88; +} +a:hover{ + color: #ffffff; +} +pre{ + font-family: "menlo"; + font-size: 1rem; + + color: #cccccc; + font-weight: bold; + + border: 0.2rem solid #cccccc; + border-radius: 15px; + padding : 1rem; +} +img{ + display: block; + margin: auto; +} +blockquote{ + padding: 0.1rem; + padding-left: 1rem; + padding-right: 1rem; + + border-radius: 25px; + + background-color: #cccccc; + color: #000000; +} +table{ + border-collapse: collapse; +} +th, td{ + padding: 0.75rem; + + border: solid #cccccc; + border-radius: 50px; +} +#menu{ + display: flex; + + justify-content: center; + align-items: center; +} +#menu a{ + text-decoration: none; + + margin-left: 3rem; + margin-right: 3rem; +} +#menu a:visited{ + color: #ffddaa; +} +#menu img{ + margin-left: 1rem; + margin-right: 1rem; +} diff --git a/prj b/prj new file mode 100755 index 0000000..b74d7f9 --- /dev/null +++ b/prj @@ -0,0 +1,4 @@ +#!/bin/bash + +cd ~/dev +cd $1 2>/dev/null && nvim . || ( ( cd ${1%/*} 2>/dev/null && nvim ${1##*/} ) || nvim $1 ) diff --git a/rld-comp b/rld-comp new file mode 100755 index 0000000..8986d92 --- /dev/null +++ b/rld-comp @@ -0,0 +1,37 @@ +#!/bin/bash + +#comp=`cat completion` +#echo $comp +# +#opt=$(ls ~/.minecraft/mods) +#comp=$(sed "s/'.*' mcm/'`echo $opt`' mcm \n/" <<< $comp) +# +#opt="" +#fich=$(ls ~/dev/script/newp-template) +#for var in $fich; do +# opt+=" ${var%.*}" +#done +#comp=$(sed "s/'.*' newp/'`echo $opt`' newp;/" <<< $comp) +# +#opt=$(ls ~/dev) +#comp=$(sed "s/'.*' prj/'`echo $opt`' prj;/" <<< $comp) +# +#echo -e $comp + +cd ~/dev/script +rm completion +touch completion +echo "#!/bin/bash" >> completion + +echo "complete -W '"$(ls ~/.minecraft/mods)"' mcm" >> completion + +fich=$(ls ~/dev/script/newp-template) +for var in $fich; do + opt+=" ${var%.*}" +done +opt=${opt# } +echo "complete -W '$opt' newp" >> completion + +echo "complete -W '"$(ls ~/dev)"' prj" >> completion + +. ./completion diff --git a/rls b/rls new file mode 100755 index 0000000..ec2d215 --- /dev/null +++ b/rls @@ -0,0 +1,20 @@ +#!/bin/bash + +if [ $1 != "" ]; then + cd $1 +fi + +project=$(grep "^\(project(\)" CMakeLists.txt) || exit +project=${project#project(} +project=${project%% *} +cd $(pwd)/build +cmake -DCMAKE_BUILD_TYPE=Release .. +make + +figlet "noice" | lolcat + +echo -n "lunch $project ? (y/n) " +read input +if [[ input -eq "y" ]]; then + ./$project +fi